Skip to content

Commit edcdd16

Browse files
author
Aidan Lee
committed
use the thread id c function less
1 parent 3a77227 commit edcdd16

2 files changed

Lines changed: 3 additions & 18 deletions

File tree

src/hx/Debug.cpp

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -245,12 +245,7 @@ StackContext::~StackContext()
245245
void StackContext::onThreadAttach()
246246
{
247247
#ifdef HXCPP_STACK_IDS
248-
mThreadId =
249-
#if (HXCPP_API_LEVEL>=500)
250-
hx::thread::Thread_obj::id();
251-
#else
252-
__hxcpp_GetCurrentThreadNumber();
253-
#endif
248+
mThreadId = hx::thread::Thread_obj::id();
254249

255250
{
256251
std::lock_guard<std::mutex> guard(sStackMapMutex);

src/hx/Debugger.cpp

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1261,12 +1261,7 @@ void __hxcpp_dbg_setEventNotificationHandler(Dynamic handler)
12611261
if (hx::g_eventNotificationHandler != null()) {
12621262
GCRemoveRoot(&(hx::g_eventNotificationHandler.mPtr));
12631263
}
1264-
hx::g_debugThreadNumber =
1265-
#if (HXCPP_API_LEVEL>=500)
1266-
hx::thread::Thread_obj::id();
1267-
#else
1268-
__hxcpp_GetCurrentThreadNumber();
1269-
#endif
1264+
hx::g_debugThreadNumber = hx::thread::Thread_obj::id();
12701265
hx::g_eventNotificationHandler = handler;
12711266
GCAddRoot(&(hx::g_eventNotificationHandler.mPtr));
12721267
}
@@ -1281,12 +1276,7 @@ void __hxcpp_dbg_enableCurrentThreadDebugging(bool enable)
12811276

12821277
int __hxcpp_dbg_getCurrentThreadNumber()
12831278
{
1284-
return
1285-
#if (HXCPP_API_LEVEL>=500)
1286-
hx::thread::Thread_obj::id();
1287-
#else
1288-
__hxcpp_GetCurrentThreadNumber();
1289-
#endif
1279+
return hx::thread::Thread_obj::id();
12901280
}
12911281

12921282

0 commit comments

Comments
 (0)