| OLD | NEW |
| 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 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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) |
| 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) | 147 #elif defined(OS_POSIX) && defined(OS_AIX) |
| 148 return pthread_self(); |
| 149 #elif defined(OS_POSIX) && !defined(OS_AIX) |
| 148 return reinterpret_cast<int64_t>(pthread_self()); | 150 return reinterpret_cast<int64_t>(pthread_self()); |
| 149 #endif | 151 #endif |
| 150 } | 152 } |
| 151 | 153 |
| 152 // static | 154 // static |
| 153 PlatformThreadRef PlatformThread::CurrentRef() { | 155 PlatformThreadRef PlatformThread::CurrentRef() { |
| 154 return PlatformThreadRef(pthread_self()); | 156 return PlatformThreadRef(pthread_self()); |
| 155 } | 157 } |
| 156 | 158 |
| 157 // static | 159 // static |
| (...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 286 return ThreadPriority::NORMAL; | 288 return ThreadPriority::NORMAL; |
| 287 } | 289 } |
| 288 | 290 |
| 289 return internal::NiceValueToThreadPriority(nice_value); | 291 return internal::NiceValueToThreadPriority(nice_value); |
| 290 #endif // !defined(OS_NACL) | 292 #endif // !defined(OS_NACL) |
| 291 } | 293 } |
| 292 | 294 |
| 293 #endif // !defined(OS_MACOSX) | 295 #endif // !defined(OS_MACOSX) |
| 294 | 296 |
| 295 } // namespace base | 297 } // namespace base |
| OLD | NEW |