Thread: set names on BSDs after 062566b67c

This commit is contained in:
Jan Beich 2021-08-10 16:37:14 +00:00
parent 5b7557acd4
commit ae39923223

View File

@ -33,7 +33,7 @@
#include <sys/syscall.h>
#endif
#if defined(__DragonFly__) || defined(__FreeBSD__)
#if defined(__DragonFly__) || defined(__FreeBSD__) || defined(__OpenBSD__)
#include <pthread_np.h>
#elif defined(__NetBSD__)
#include <lwp.h>
@ -125,6 +125,10 @@ void SetCurrentThreadName(const char* threadName) {
pthread_setname_np(pthread_self(), threadName);
#elif defined(__APPLE__)
pthread_setname_np(threadName);
#elif defined(__DragonFly__) || defined(__FreeBSD__) || defined(__OpenBSD__)
pthread_set_name_np(pthread_self(), threadName);
#elif defined(__NetBSD__)
pthread_setname_np(pthread_self(), "%s", (void*)threadName);
#endif
// Do nothing