debugging current thread id on apple too

This commit is contained in:
David CARLIER 2021-01-22 20:43:43 +00:00
parent 011b2cecf2
commit eb5bb253f3

View File

@ -40,7 +40,7 @@
# include <windows.h>
#endif
#if (defined(__linux__) && defined(__GLIBC__) && defined(__GLIBC_MINOR__)) || defined(__NetBSD__)
#if (defined(__linux__) && defined(__GLIBC__) && defined(__GLIBC_MINOR__)) || defined(__NetBSD__) || defined(__APPLE__)
# include <pthread.h>
#endif
@ -104,6 +104,8 @@ namespace VS
pthread_setname_np(pthread_self(), "%s", const_cast<char *>(name));
#elif defined(__OpenBSD__)
pthread_set_name_np(pthread_self(), const_cast<char *>(name));
#elif defined(__APPLE__)
pthread_setname_np(name);
#elif defined(__HAIKU__)
rename_thread(find_thread(nullptr), name);
#endif