Skip to content

Commit

Permalink
Thread: set names on BSDs after 062566b
Browse files Browse the repository at this point in the history
  • Loading branch information
jbeich committed Aug 10, 2021
1 parent 5b7557a commit ae39923
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion Common/Thread/ThreadUtil.cpp
Expand Up @@ -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>
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit ae39923

Please sign in to comment.