Bug 648735 - Use pthread_self() on OpenBSD to get current thread id; r=cjones
authorLandry Breuil <landry@openbsd.org>
Tue, 20 Sep 2011 13:23:03 +0100
changeset 77194 bb924724a032cd1457aec0dc9d9a7579e66a0aeb
parent 77193 f78d9f4f5234a05770aaa06e1b28280acf8c8aa5
child 77195 226136c5812e8a42c1c3ad1a20de7014445f14a3
push id3
push userfelipc@gmail.com
push dateFri, 30 Sep 2011 20:09:13 +0000
reviewerscjones
bugs648735
milestone9.0a1
Bug 648735 - Use pthread_self() on OpenBSD to get current thread id; r=cjones
ipc/chromium/src/base/platform_thread_posix.cc
--- a/ipc/chromium/src/base/platform_thread_posix.cc
+++ b/ipc/chromium/src/base/platform_thread_posix.cc
@@ -28,16 +28,19 @@ static void* ThreadFunc(void* closure) {
 }
 
 // static
 PlatformThreadId PlatformThread::CurrentId() {
   // Pthreads doesn't have the concept of a thread ID, so we have to reach down
   // into the kernel.
 #if defined(OS_MACOSX)
   return mach_thread_self();
+#elif defined (__OpenBSD__)
+  // TODO(BSD): find a better thread ID
+  return (intptr_t)(pthread_self());
 #elif defined(OS_LINUX)
   return syscall(__NR_gettid);
 #endif
 }
 
 // static
 void PlatformThread::YieldCurrentThread() {
   sched_yield();