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

Side by Side Diff: base/threading/platform_thread_posix.cc

Issue 10795083: Enable some parts of base that were previously disabled in base_untrusted (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 5 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 | Annotate | Revision Log
« no previous file with comments | « base/rand_util_nacl.cc ('k') | base/time_posix.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium 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 #include "base/threading/platform_thread.h" 5 #include "base/threading/platform_thread.h"
6 6
7 #include <errno.h> 7 #include <errno.h>
8 #include <sched.h> 8 #include <sched.h>
9 9
10 #include "base/lazy_instance.h" 10 #include "base/lazy_instance.h"
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after
155 // static 155 // static
156 PlatformThreadId PlatformThread::CurrentId() { 156 PlatformThreadId PlatformThread::CurrentId() {
157 // Pthreads doesn't have the concept of a thread ID, so we have to reach down 157 // Pthreads doesn't have the concept of a thread ID, so we have to reach down
158 // into the kernel. 158 // into the kernel.
159 #if defined(OS_LINUX) 159 #if defined(OS_LINUX)
160 return syscall(__NR_gettid); 160 return syscall(__NR_gettid);
161 #elif defined(OS_ANDROID) 161 #elif defined(OS_ANDROID)
162 return gettid(); 162 return gettid();
163 #elif defined(OS_SOLARIS) 163 #elif defined(OS_SOLARIS)
164 return pthread_self(); 164 return pthread_self();
165 #elif defined(OS_NACL) 165 #elif defined(OS_NACL) && defined(__GLIBC__)
166 return pthread_self();
167 #elif defined(OS_NACL) && !defined(__GLIBC__)
166 // Pointers are 32-bits in NaCl. 168 // Pointers are 32-bits in NaCl.
167 return reinterpret_cast<int32>(pthread_self()); 169 return reinterpret_cast<int32>(pthread_self());
168 #elif defined(OS_POSIX) 170 #elif defined(OS_POSIX)
169 return reinterpret_cast<int64>(pthread_self()); 171 return reinterpret_cast<int64>(pthread_self());
170 #endif 172 #endif
171 } 173 }
172 174
173 // static 175 // static
174 void PlatformThread::YieldCurrentThread() { 176 void PlatformThread::YieldCurrentThread() {
175 sched_yield(); 177 sched_yield();
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
275 #if !defined(OS_MACOSX) 277 #if !defined(OS_MACOSX)
276 // Mac OS X uses lower-level mach APIs. 278 // Mac OS X uses lower-level mach APIs.
277 279
278 // static 280 // static
279 void PlatformThread::SetThreadPriority(PlatformThreadHandle, ThreadPriority) { 281 void PlatformThread::SetThreadPriority(PlatformThreadHandle, ThreadPriority) {
280 // TODO(crogers): Implement, see http://crbug.com/116172 282 // TODO(crogers): Implement, see http://crbug.com/116172
281 } 283 }
282 #endif 284 #endif
283 285
284 } // namespace base 286 } // namespace base
OLDNEW
« no previous file with comments | « base/rand_util_nacl.cc ('k') | base/time_posix.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698