mirror of
https://github.com/wolfpld/tracy.git
synced 2024-11-26 16:04:34 +00:00
Proper pthread_threadid_np call.
This commit is contained in:
parent
c7cb89307f
commit
7ecc6b54d4
@ -92,7 +92,7 @@ void SetThreadName( std::thread::native_handle_type handle, const char* name )
|
|||||||
# ifdef _WIN32
|
# ifdef _WIN32
|
||||||
data->id = GetThreadId( static_cast<HANDLE>( handle ) );
|
data->id = GetThreadId( static_cast<HANDLE>( handle ) );
|
||||||
# elif defined __APPLE__
|
# elif defined __APPLE__
|
||||||
pthread_thread_id( handle, data->id );
|
pthread_thread_id( handle, &data->id );
|
||||||
# else
|
# else
|
||||||
data->id = (uint64_t)handle;
|
data->id = (uint64_t)handle;
|
||||||
# endif
|
# endif
|
||||||
|
@ -26,7 +26,7 @@ static inline uint64_t GetThreadHandle()
|
|||||||
return uint64_t( GetCurrentThreadId() );
|
return uint64_t( GetCurrentThreadId() );
|
||||||
#elif defined __APPLE__
|
#elif defined __APPLE__
|
||||||
uint64_t id;
|
uint64_t id;
|
||||||
pthread_threadid_np( pthread_self(), id );
|
pthread_threadid_np( pthread_self(), &id );
|
||||||
return id;
|
return id;
|
||||||
#else
|
#else
|
||||||
static_assert( sizeof( decltype( pthread_self() ) ) <= sizeof( uint64_t ), "Thread handle too big to fit in protocol" );
|
static_assert( sizeof( decltype( pthread_self() ) ) <= sizeof( uint64_t ), "Thread handle too big to fit in protocol" );
|
||||||
|
Loading…
Reference in New Issue
Block a user