1
0
mirror of https://github.com/wolfpld/tracy.git synced 2025-03-20 07:40:02 +08:00

Fix thread ids on osx, iphone.

This commit is contained in:
Bartosz Taudul
2017-11-03 10:49:49 +01:00
parent 3659afac2a
commit 1d9542ea25
2 changed files with 6 additions and 0 deletions
+4
View File
@@ -24,6 +24,10 @@ static inline uint64_t GetThreadHandle()
#ifdef _WIN32
static_assert( sizeof( decltype( GetCurrentThreadId() ) ) <= sizeof( uint64_t ), "Thread handle too big to fit in protocol" );
return uint64_t( GetCurrentThreadId() );
#elif defined __MACOSX__ || defined __IPHONE__
uint64_t id;
pthread_threadid_np( pthread_self(), id );
return id;
#else
static_assert( sizeof( decltype( pthread_self() ) ) <= sizeof( uint64_t ), "Thread handle too big to fit in protocol" );
return uint64_t( pthread_self() );