Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(218)

Unified Diff: src/base/platform/platform-posix.cc

Issue 649553002: Sync OS::GetCurrentThreadId with chromium's/blink's implementation (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/base/platform/platform-posix.cc
diff --git a/src/base/platform/platform-posix.cc b/src/base/platform/platform-posix.cc
index 0fc04fc11088b28e4a0ff5c451e7bf45fcab77fd..cd7e09a39ee491a6c59411e8c69257ef5113b3ee 100644
--- a/src/base/platform/platform-posix.cc
+++ b/src/base/platform/platform-posix.cc
@@ -253,14 +253,14 @@ int OS::GetCurrentProcessId() {
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));
-#elif defined(SYS_gettid)
- return static_cast<int>(syscall(SYS_gettid));
+#elif V8_OS_ANDROID
+ return static_cast<int>(gettid());
#else
- // PNaCL doesn't have a way to get an integral thread ID, but it doesn't
- // really matter, because we only need it in PerfJitLogger::LogRecordedBuffer.
- return 0;
+ return reinterpret_cast<int>(pthread_self());
#endif
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698