mirror of
https://github.com/wolfpld/tracy.git
synced 2024-11-30 01:04:36 +00:00
Merge pull request #499 from ReplayCoding/other_thread_name
Always fallback to using native thread name...
This commit is contained in:
commit
a27ecd7135
@ -205,7 +205,8 @@ TRACY_API const char* GetThreadName( uint32_t id )
|
||||
}
|
||||
ptr = ptr->next;
|
||||
}
|
||||
#else
|
||||
#endif
|
||||
|
||||
#if defined _WIN32
|
||||
# ifdef TRACY_UWP
|
||||
static auto _GetThreadDescription = &::GetThreadDescription;
|
||||
@ -230,12 +231,7 @@ TRACY_API const char* GetThreadName( uint32_t id )
|
||||
#elif defined __linux__
|
||||
int cs, fd;
|
||||
char path[32];
|
||||
# ifdef __ANDROID__
|
||||
int tid = gettid();
|
||||
# else
|
||||
int tid = (int) syscall( SYS_gettid );
|
||||
# endif
|
||||
snprintf( path, sizeof( path ), "/proc/self/task/%d/comm", tid );
|
||||
snprintf( path, sizeof( path ), "/proc/self/task/%d/comm", id );
|
||||
sprintf( buf, "%" PRIu32, id );
|
||||
# ifndef __ANDROID__
|
||||
pthread_setcancelstate( PTHREAD_CANCEL_DISABLE, &cs );
|
||||
@ -257,7 +253,7 @@ TRACY_API const char* GetThreadName( uint32_t id )
|
||||
# endif
|
||||
return buf;
|
||||
#endif
|
||||
#endif
|
||||
|
||||
sprintf( buf, "%" PRIu32, id );
|
||||
return buf;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user