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

Side by Side Diff: src/base/platform/platform-posix.cc

Issue 1021563003: Version 4.1.0.23 (cherry-pick) (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@4.1
Patch Set: Created 5 years, 9 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 unified diff | Download patch
« no previous file with comments | « include/v8-version.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // Platform-specific code for POSIX goes here. This is not a platform on its 5 // Platform-specific code for POSIX goes here. This is not a platform on its
6 // own, but contains the parts which are the same across the POSIX platforms 6 // own, but contains the parts which are the same across the POSIX platforms
7 // Linux, MacOS, FreeBSD, OpenBSD, NetBSD and QNX. 7 // Linux, MacOS, FreeBSD, OpenBSD, NetBSD and QNX.
8 8
9 #include <errno.h> 9 #include <errno.h>
10 #include <limits.h> 10 #include <limits.h>
(...skipping 242 matching lines...) Expand 10 before | Expand all | Expand 10 after
253 } 253 }
254 254
255 255
256 int OS::GetCurrentThreadId() { 256 int OS::GetCurrentThreadId() {
257 #if V8_OS_MACOSX || (V8_OS_ANDROID && defined(__APPLE__)) 257 #if V8_OS_MACOSX || (V8_OS_ANDROID && defined(__APPLE__))
258 return static_cast<int>(pthread_mach_thread_np(pthread_self())); 258 return static_cast<int>(pthread_mach_thread_np(pthread_self()));
259 #elif V8_OS_LINUX 259 #elif V8_OS_LINUX
260 return static_cast<int>(syscall(__NR_gettid)); 260 return static_cast<int>(syscall(__NR_gettid));
261 #elif V8_OS_ANDROID 261 #elif V8_OS_ANDROID
262 return static_cast<int>(gettid()); 262 return static_cast<int>(gettid());
263 #elif V8_OS_SOLARIS
264 return static_cast<int>(pthread_self());
263 #else 265 #else
264 return static_cast<int>(reinterpret_cast<intptr_t>(pthread_self())); 266 return static_cast<int>(reinterpret_cast<intptr_t>(pthread_self()));
265 #endif 267 #endif
266 } 268 }
267 269
268 270
269 // ---------------------------------------------------------------------------- 271 // ----------------------------------------------------------------------------
270 // POSIX date/time support. 272 // POSIX date/time support.
271 // 273 //
272 274
(...skipping 397 matching lines...) Expand 10 before | Expand all | Expand 10 after
670 672
671 void Thread::SetThreadLocal(LocalStorageKey key, void* value) { 673 void Thread::SetThreadLocal(LocalStorageKey key, void* value) {
672 pthread_key_t pthread_key = LocalKeyToPthreadKey(key); 674 pthread_key_t pthread_key = LocalKeyToPthreadKey(key);
673 int result = pthread_setspecific(pthread_key, value); 675 int result = pthread_setspecific(pthread_key, value);
674 DCHECK_EQ(0, result); 676 DCHECK_EQ(0, result);
675 USE(result); 677 USE(result);
676 } 678 }
677 679
678 680
679 } } // namespace v8::base 681 } } // namespace v8::base
OLDNEW
« no previous file with comments | « include/v8-version.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698