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 id21187
push usermak77@bonardo.net
push dateWed, 21 Sep 2011 08:36:41 +0000
treeherdermozilla-central@3178f1c42505 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerscjones
bugs648735
milestone9.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
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();