Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/wolfpld/tracy.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
Diffstat (limited to 'common')
-rw-r--r--common/TracySystem.cpp8
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