summaryrefslogtreecommitdiff
path: root/Source/Core/Common/Thread.cpp
diff options
context:
space:
mode:
authorMatthew Parlane <parlane@gmail.com>2017-03-28 17:19:35 +1300
committerGitHub <noreply@github.com>2017-03-28 17:19:35 +1300
commit85d74a506f6e4024ae1ffdf857d68ebed96fa4a9 (patch)
tree615c4104ef8ab87cdc6267b9f856140eab025aa8 /Source/Core/Common/Thread.cpp
parent8c23888968cbc8b513c5b45df5014213ba356bc1 (diff)
parent0831dad467374f11256b5e63ca66b9dff5bf2463 (diff)
Merge pull request #4951 from waddlesplash/haiku-2
Initial support for Haiku.
Diffstat (limited to 'Source/Core/Common/Thread.cpp')
-rw-r--r--Source/Core/Common/Thread.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/Source/Core/Common/Thread.cpp b/Source/Core/Common/Thread.cpp
index 909016e7ae..190653ee31 100644
--- a/Source/Core/Common/Thread.cpp
+++ b/Source/Core/Common/Thread.cpp
@@ -16,6 +16,8 @@
#include <mach/mach.h>
#elif defined BSD4_4 || defined __FreeBSD__ || defined __OpenBSD__
#include <pthread_np.h>
+#elif defined __HAIKU__
+#include <OS.h>
#endif
#ifdef USE_VTUNE
@@ -136,6 +138,8 @@ void SetCurrentThreadName(const char* szThreadName)
pthread_setname_np(szThreadName);
#elif defined __FreeBSD__ || defined __OpenBSD__
pthread_set_name_np(pthread_self(), szThreadName);
+#elif defined __HAIKU__
+ rename_thread(find_thread(nullptr), szThreadName);
#else
// linux doesn't allow to set more than 16 bytes, including \0.
pthread_setname_np(pthread_self(), std::string(szThreadName).substr(0, 15).c_str());