blob: c1d8794c132c78eb1a4a6223cfa07cc7a26bda2a (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
|
$NetBSD: patch-base_thread.cc,v 1.2 2021/02/15 14:50:23 ryoon Exp $
* tweak for NetBSD pthread_setname_np(3)
--- base/thread.cc.orig 2021-02-15 03:48:53.000000000 +0000
+++ base/thread.cc
@@ -145,9 +145,11 @@ void Thread::Start(const std::string &th
// WASM doesn't support setname?
#elif defined(__APPLE__) // !OS_WASM
pthread_setname_np(thread_name.c_str());
-#else // !(OS_WASM | __APPLE__)
+#elif defined(OS_NETBSD)
+ pthread_setname_np(*state_->handle, "%s", (void *)thread_name.c_str());
+#else // !(OS_WASM | __APPLE__ | OS_NETBSD)
pthread_setname_np(*state_->handle, thread_name.c_str());
-#endif // !(OS_WASM | __APPLE__)
+#endif // !(OS_WASM | __APPLE__ | OS_NETBSD)
}
}
|