summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJan Beich <jbeich@FreeBSD.org>2016-10-10 04:25:19 +0200
committerJan Beich <jbeich@FreeBSD.org>2016-10-28 01:28:29 +0200
commit1410bd3bd03f057a96348c9167bb7f5c0cb3b0de (patch)
treef525cae86ff529deff3c571d6c1e71856b2499f8
parenthooks: convert pre-commit to POSIX syntax (diff)
downloadyuzu-1410bd3bd03f057a96348c9167bb7f5c0cb3b0de.tar
yuzu-1410bd3bd03f057a96348c9167bb7f5c0cb3b0de.tar.gz
yuzu-1410bd3bd03f057a96348c9167bb7f5c0cb3b0de.tar.bz2
yuzu-1410bd3bd03f057a96348c9167bb7f5c0cb3b0de.tar.lz
yuzu-1410bd3bd03f057a96348c9167bb7f5c0cb3b0de.tar.xz
yuzu-1410bd3bd03f057a96348c9167bb7f5c0cb3b0de.tar.zst
yuzu-1410bd3bd03f057a96348c9167bb7f5c0cb3b0de.zip
-rw-r--r--src/common/thread.cpp6
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 @@
#elif defined(_WIN32)
#include <Windows.h>
#else
-#if defined(BSD4_4) || defined(__OpenBSD__)
+#if defined(__Bitrig__) || defined(__DragonFly__) || defined(__FreeBSD__) || defined(__OpenBSD__)
#include <pthread_np.h>
#else
#include <pthread.h>
@@ -117,8 +117,10 @@ void SwitchCurrentThread() {
void SetCurrentThreadName(const char* szThreadName) {
#ifdef __APPLE__
pthread_setname_np(szThreadName);
-#elif defined(__OpenBSD__)
+#elif defined(__Bitrig__) || defined(__DragonFly__) || defined(__FreeBSD__) || defined(__OpenBSD__)
pthread_set_name_np(pthread_self(), szThreadName);
+#elif defined(__NetBSD__)
+ pthread_setname_np(pthread_self(), "%s", (void*)szThreadName);
#else
pthread_setname_np(pthread_self(), szThreadName);
#endif