mirror of
https://github.com/wolfpld/tracy.git
synced 2024-11-22 14:44:34 +00:00
Always fallback to using native thread name...
...even when TRACY_ENABLE is defined.
This commit is contained in:
parent
70e22ad045
commit
9da24b713c
@ -205,8 +205,9 @@ TRACY_API const char* GetThreadName( uint32_t id )
|
||||
}
|
||||
ptr = ptr->next;
|
||||
}
|
||||
#else
|
||||
# if defined _WIN32
|
||||
#endif
|
||||
|
||||
#if defined _WIN32
|
||||
# ifdef TRACY_UWP
|
||||
static auto _GetThreadDescription = &::GetThreadDescription;
|
||||
# else
|
||||
@ -227,15 +228,10 @@ TRACY_API const char* GetThreadName( uint32_t id )
|
||||
}
|
||||
}
|
||||
}
|
||||
# elif defined __linux__
|
||||
#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 );
|
||||
@ -256,8 +252,8 @@ TRACY_API const char* GetThreadName( uint32_t id )
|
||||
pthread_setcancelstate( cs, 0 );
|
||||
# endif
|
||||
return buf;
|
||||
# endif
|
||||
#endif
|
||||
|
||||
sprintf( buf, "%" PRIu32, id );
|
||||
return buf;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user