diff options
Diffstat (limited to 'common')
-rw-r--r-- | common/TracySystem.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/common/TracySystem.cpp b/common/TracySystem.cpp index b9754d33..1248fdee 100644 --- a/common/TracySystem.cpp +++ b/common/TracySystem.cpp @@ -155,14 +155,22 @@ TRACY_API void SetThreadName( const char* name ) const auto sz = strlen( name ); if( sz <= 15 ) { +#if defined __APPLE__ + pthread_setname_np( name ); +#else pthread_setname_np( pthread_self(), name ); +#endif } else { char buf[16]; memcpy( buf, name, 15 ); buf[15] = '\0'; +#if defined __APPLE__ + pthread_setname_np( buf ); +#else pthread_setname_np( pthread_self(), buf ); +#endif } } #endif |