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

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

Issue 2884353004: fuchsia: base_unittests (mostly) compiling (Closed)
Patch Set: rebase Created 3 years, 7 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 | « base/test/launcher/test_launcher.cc ('k') | base/trace_event/malloc_dump_provider.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 <pthread.h> 8 #include <pthread.h>
9 #include <sched.h> 9 #include <sched.h>
10 #include <stddef.h> 10 #include <stddef.h>
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after
130 // static 130 // static
131 PlatformThreadId PlatformThread::CurrentId() { 131 PlatformThreadId PlatformThread::CurrentId() {
132 // Pthreads doesn't have the concept of a thread ID, so we have to reach down 132 // Pthreads doesn't have the concept of a thread ID, so we have to reach down
133 // into the kernel. 133 // into the kernel.
134 #if defined(OS_MACOSX) 134 #if defined(OS_MACOSX)
135 return pthread_mach_thread_np(pthread_self()); 135 return pthread_mach_thread_np(pthread_self());
136 #elif defined(OS_LINUX) 136 #elif defined(OS_LINUX)
137 return syscall(__NR_gettid); 137 return syscall(__NR_gettid);
138 #elif defined(OS_ANDROID) 138 #elif defined(OS_ANDROID)
139 return gettid(); 139 return gettid();
140 #elif defined(OS_SOLARIS) || defined(OS_QNX) 140 #elif defined(OS_SOLARIS) || defined(OS_QNX) || defined(OS_FUCHSIA)
141 return pthread_self(); 141 return pthread_self();
142 #elif defined(OS_NACL) && defined(__GLIBC__) 142 #elif defined(OS_NACL) && defined(__GLIBC__)
143 return pthread_self(); 143 return pthread_self();
144 #elif defined(OS_NACL) && !defined(__GLIBC__) 144 #elif defined(OS_NACL) && !defined(__GLIBC__)
145 // Pointers are 32-bits in NaCl. 145 // Pointers are 32-bits in NaCl.
146 return reinterpret_cast<int32_t>(pthread_self()); 146 return reinterpret_cast<int32_t>(pthread_self());
147 #elif defined(OS_POSIX) && defined(OS_AIX) 147 #elif defined(OS_POSIX) && defined(OS_AIX)
148 return pthread_self(); 148 return pthread_self();
149 #elif defined(OS_POSIX) && !defined(OS_AIX) 149 #elif defined(OS_POSIX) && !defined(OS_AIX)
150 return reinterpret_cast<int64_t>(pthread_self()); 150 return reinterpret_cast<int64_t>(pthread_self());
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after
288 return ThreadPriority::NORMAL; 288 return ThreadPriority::NORMAL;
289 } 289 }
290 290
291 return internal::NiceValueToThreadPriority(nice_value); 291 return internal::NiceValueToThreadPriority(nice_value);
292 #endif // !defined(OS_NACL) 292 #endif // !defined(OS_NACL)
293 } 293 }
294 294
295 #endif // !defined(OS_MACOSX) 295 #endif // !defined(OS_MACOSX)
296 296
297 } // namespace base 297 } // namespace base
OLDNEW
« no previous file with comments | « base/test/launcher/test_launcher.cc ('k') | base/trace_event/malloc_dump_provider.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698