blob: 7d8de2b7ae8027fafdda14accebf01bac062000b (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
|
--- third_party/blink/renderer/platform/wtf/threading.cc.orig 2019-03-11 22:01:04 UTC
+++ third_party/blink/renderer/platform/wtf/threading.cc
@@ -17,12 +17,16 @@
#error Blink does not support threading on your platform.
#endif
-#if defined(OS_LINUX)
+#if defined(OS_LINUX) || defined(OS_BSD)
#include <sys/syscall.h>
#elif defined(OS_ANDROID)
#include <sys/types.h>
#endif
+#if defined(OS_BSD)
+#include <pthread_np.h>
+#endif
+
namespace WTF {
// Current thread identity
@@ -38,6 +42,8 @@ ThreadIdentifier CurrentThreadSyscall() {
return syscall(__NR_gettid);
#elif defined(OS_ANDROID)
return gettid();
+#elif defined(OS_BSD)
+ return pthread_getthreadid_np();
#else
return reinterpret_cast<uintptr_t>(pthread_self());
#endif
|