diff options
Diffstat (limited to 'src/common/thread.cpp')
| -rw-r--r-- | src/common/thread.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/common/thread.cpp b/src/common/thread.cpp index 6e7b39b9a..a4f5fa336 100644 --- a/src/common/thread.cpp +++ b/src/common/thread.cpp | |||
| @@ -8,7 +8,7 @@ | |||
| 8 | #elif defined(_WIN32) | 8 | #elif defined(_WIN32) |
| 9 | #include <Windows.h> | 9 | #include <Windows.h> |
| 10 | #else | 10 | #else |
| 11 | #if defined(BSD4_4) || defined(__OpenBSD__) | 11 | #if defined(__Bitrig__) || defined(__DragonFly__) || defined(__FreeBSD__) || defined(__OpenBSD__) |
| 12 | #include <pthread_np.h> | 12 | #include <pthread_np.h> |
| 13 | #else | 13 | #else |
| 14 | #include <pthread.h> | 14 | #include <pthread.h> |
| @@ -117,8 +117,10 @@ void SwitchCurrentThread() { | |||
| 117 | void SetCurrentThreadName(const char* szThreadName) { | 117 | void SetCurrentThreadName(const char* szThreadName) { |
| 118 | #ifdef __APPLE__ | 118 | #ifdef __APPLE__ |
| 119 | pthread_setname_np(szThreadName); | 119 | pthread_setname_np(szThreadName); |
| 120 | #elif defined(__OpenBSD__) | 120 | #elif defined(__Bitrig__) || defined(__DragonFly__) || defined(__FreeBSD__) || defined(__OpenBSD__) |
| 121 | pthread_set_name_np(pthread_self(), szThreadName); | 121 | pthread_set_name_np(pthread_self(), szThreadName); |
| 122 | #elif defined(__NetBSD__) | ||
| 123 | pthread_setname_np(pthread_self(), "%s", (void*)szThreadName); | ||
| 122 | #else | 124 | #else |
| 123 | pthread_setname_np(pthread_self(), szThreadName); | 125 | pthread_setname_np(pthread_self(), szThreadName); |
| 124 | #endif | 126 | #endif |