From cf5547227d9fffd9fb0043ce0b5633b831536eb6 Mon Sep 17 00:00:00 2001
From: David CARLIER <devnexen@gmail.com>
Date: Sun, 23 Aug 2020 14:39:32 +0100
Subject: Complete Haiku platform support. (#10311)

Fixing linkage/libraries missing issue.
Implements missing platform specifics.
---
 src/threading/thread.cpp | 4 ++++
 src/threading/thread.h   | 4 ++++
 2 files changed, 8 insertions(+)

(limited to 'src/threading')

diff --git a/src/threading/thread.cpp b/src/threading/thread.cpp
index e0f808c4d..f678a09be 100644
--- a/src/threading/thread.cpp
+++ b/src/threading/thread.cpp
@@ -225,6 +225,10 @@ void Thread::setName(const std::string &name)
 
 	pthread_setname_np(name.c_str());
 
+#elif defined(__HAIKU__)
+
+	rename_thread(find_thread(NULL), name.c_str());
+
 #elif defined(_MSC_VER)
 
 	// Windows itself doesn't support thread names,
diff --git a/src/threading/thread.h b/src/threading/thread.h
index cea92226f..3946335f5 100644
--- a/src/threading/thread.h
+++ b/src/threading/thread.h
@@ -36,6 +36,10 @@ DEALINGS IN THE SOFTWARE.
 	#include <sys/thread.h> // for tid_t
 #endif
 
+#ifdef __HAIKU__
+	#include <kernel/OS.h>
+#endif
+
 /*
  * On platforms using pthreads, these five priority classes correlate to
  * even divisions between the minimum and maximum reported thread priority.
-- 
cgit v1.2.3