Răsfoiți Sursa

Use pthread_set_name_np() on OpenBSD.

Anthony J. Bentley 12 ani în urmă
părinte
comite
dad3655a6d
1 a modificat fișierele cu 3 adăugiri și 1 ștergeri
  1. 3 1
      src/common/thread.cpp

+ 3 - 1
src/common/thread.cpp

@@ -7,7 +7,7 @@
 
 
 #ifdef __APPLE__
 #ifdef __APPLE__
 #include <mach/mach.h>
 #include <mach/mach.h>
-#elif defined BSD4_4
+#elif defined(BSD4_4) || defined(__OpenBSD__)
 #include <pthread_np.h>
 #include <pthread_np.h>
 #endif
 #endif
 
 
@@ -123,6 +123,8 @@ void SetCurrentThreadName(const char* szThreadName)
 {
 {
 #ifdef __APPLE__
 #ifdef __APPLE__
     pthread_setname_np(szThreadName);
     pthread_setname_np(szThreadName);
+#elif defined(__OpenBSD__)
+    pthread_set_name_np(pthread_self(), szThreadName);
 #else
 #else
     pthread_setname_np(pthread_self(), szThreadName);
     pthread_setname_np(pthread_self(), szThreadName);
 #endif
 #endif