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 <sched.h> | 8 #include <sched.h> |
9 | 9 |
10 #include "base/lazy_instance.h" | 10 #include "base/lazy_instance.h" |
(...skipping 22 matching lines...) Expand all Loading... |
33 namespace base { | 33 namespace base { |
34 | 34 |
35 #if defined(OS_MACOSX) | 35 #if defined(OS_MACOSX) |
36 void InitThreading(); | 36 void InitThreading(); |
37 #endif | 37 #endif |
38 | 38 |
39 namespace { | 39 namespace { |
40 | 40 |
41 #if !defined(OS_MACOSX) | 41 #if !defined(OS_MACOSX) |
42 // Mac name code is in in platform_thread_mac.mm. | 42 // Mac name code is in in platform_thread_mac.mm. |
43 LazyInstance<ThreadLocalPointer<char>, | 43 LazyInstance<ThreadLocalPointer<char> >::Leaky |
44 LeakyLazyInstanceTraits<ThreadLocalPointer<char> > > | |
45 current_thread_name = LAZY_INSTANCE_INITIALIZER; | 44 current_thread_name = LAZY_INSTANCE_INITIALIZER; |
46 #endif | 45 #endif |
47 | 46 |
48 struct ThreadParams { | 47 struct ThreadParams { |
49 PlatformThread::Delegate* delegate; | 48 PlatformThread::Delegate* delegate; |
50 bool joinable; | 49 bool joinable; |
51 }; | 50 }; |
52 | 51 |
53 void* ThreadFunc(void* params) { | 52 void* ThreadFunc(void* params) { |
54 ThreadParams* thread_params = static_cast<ThreadParams*>(params); | 53 ThreadParams* thread_params = static_cast<ThreadParams*>(params); |
(...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
247 // Mac OS X uses lower-level mach APIs | 246 // Mac OS X uses lower-level mach APIs |
248 | 247 |
249 // static | 248 // static |
250 void PlatformThread::SetThreadPriority(PlatformThreadHandle, ThreadPriority) { | 249 void PlatformThread::SetThreadPriority(PlatformThreadHandle, ThreadPriority) { |
251 // TODO(crogers): implement | 250 // TODO(crogers): implement |
252 NOTIMPLEMENTED(); | 251 NOTIMPLEMENTED(); |
253 } | 252 } |
254 #endif | 253 #endif |
255 | 254 |
256 } // namespace base | 255 } // namespace base |
OLD | NEW |