blob: bb8888d61b1ec3c0926538ab0d571d24fd4fffb5 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
|
--- base/threading/platform_thread_posix.cc.orig 2021-06-09 22:13:52 UTC
+++ base/threading/platform_thread_posix.cc
@@ -32,6 +32,10 @@
#include <sys/syscall.h>
#endif
+#if defined(OS_BSD)
+#include <pthread_np.h>
+#endif
+
#if defined(OS_FUCHSIA)
#include <zircon/process.h>
#else
@@ -181,6 +185,8 @@ PlatformThreadId PlatformThread::CurrentId() {
// into the kernel.
#if defined(OS_APPLE)
return pthread_mach_thread_np(pthread_self());
+#elif defined(OS_BSD)
+ return pthread_getthreadid_np();
#elif defined(OS_LINUX) || defined(OS_CHROMEOS)
static NoDestructor<InitAtFork> init_at_fork;
if (g_thread_id == -1) {
|