Commit 3c7e4403 authored by jochen@chromium.org's avatar jochen@chromium.org

Sync OS::GetCurrentThreadId with chromium's/blink's implementation

Compare third_party/WebKit/Source/wtf/ThreadingPthreads.cpp

BUG=v8:3620
R=svenpanne@chromium.org
LOG=n

Review URL: https://codereview.chromium.org/649553002

git-svn-id: https://v8.googlecode.com/svn/branches/bleeding_edge@24511 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent 0dd69ec4
...@@ -253,14 +253,14 @@ int OS::GetCurrentProcessId() { ...@@ -253,14 +253,14 @@ int OS::GetCurrentProcessId() {
int OS::GetCurrentThreadId() { int OS::GetCurrentThreadId() {
#if defined(ANDROID) #if V8_OS_MACOSX
return static_cast<int>(pthread_mac_thread_np(pthread_self()));
#elif V8_OS_LINUX
return static_cast<int>(syscall(__NR_gettid)); return static_cast<int>(syscall(__NR_gettid));
#elif defined(SYS_gettid) #elif V8_OS_ANDROID
return static_cast<int>(syscall(SYS_gettid)); return static_cast<int>(gettid());
#else #else
// PNaCL doesn't have a way to get an integral thread ID, but it doesn't return reinterpret_cast<int>(pthread_self());
// really matter, because we only need it in PerfJitLogger::LogRecordedBuffer.
return 0;
#endif #endif
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment