aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/common/thread.cpp
diff options
context:
space:
mode:
authorGravatar Anthony J. Bentley <anthony@cathet.us>2014-08-07 22:56:58 -0600
committerGravatar Anthony J. Bentley <anthony@cathet.us>2014-08-07 22:56:58 -0600
commitdad3655a6d6371f03d86ba90ab0e86cfa34bcf4f (patch)
tree583aab4e82aeeb4e687a58510b7c7e447c9fde43 /src/common/thread.cpp
parentd0c179485392903fa413543d6b6908d45bc1f0fb (diff)
Use pthread_set_name_np() on OpenBSD.
Diffstat (limited to 'src/common/thread.cpp')
-rw-r--r--src/common/thread.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/common/thread.cpp b/src/common/thread.cpp
index c70ee37c..7341035c 100644
--- a/src/common/thread.cpp
+++ b/src/common/thread.cpp
@@ -7,7 +7,7 @@
#ifdef __APPLE__
#include <mach/mach.h>
-#elif defined BSD4_4
+#elif defined(BSD4_4) || defined(__OpenBSD__)
#include <pthread_np.h>
#endif
@@ -123,6 +123,8 @@ void SetCurrentThreadName(const char* szThreadName)
{
#ifdef __APPLE__
pthread_setname_np(szThreadName);
+#elif defined(__OpenBSD__)
+ pthread_set_name_np(pthread_self(), szThreadName);
#else
pthread_setname_np(pthread_self(), szThreadName);
#endif