blob: f31ce45687836e7d79fe7afcacbb5b3da2417cbf (
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/WebKit/Source/wtf/ThreadingPthreads.cpp.orig 2017-04-19 19:06:50 UTC
+++ third_party/WebKit/Source/wtf/ThreadingPthreads.cpp
@@ -49,11 +49,15 @@
#include <objc/objc-auto.h>
#endif
-#if OS(LINUX)
+#if OS(LINUX) || OS(BSD)
#include <sys/syscall.h>
#endif
-#if OS(LINUX) || OS(ANDROID)
+#if OS(BSD)
+#include <pthread_np.h>
+#endif
+
+#if OS(LINUX) || OS(ANDROID) || OS(BSD)
#include <unistd.h>
#endif
@@ -66,6 +70,8 @@ ThreadIdentifier currentThreadSyscall()
return pthread_mach_thread_np(pthread_self());
#elif OS(LINUX)
return syscall(__NR_gettid);
+#elif OS(BSD)
+ return pthread_getthreadid_np();
#elif OS(ANDROID)
return gettid();
#else
|