OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 26 matching lines...) Expand all Loading... |
37 #if defined(OS_MACOSX) | 37 #if defined(OS_MACOSX) |
38 void InitThreading(); | 38 void InitThreading(); |
39 #endif | 39 #endif |
40 | 40 |
41 namespace { | 41 namespace { |
42 | 42 |
43 #if !defined(OS_MACOSX) | 43 #if !defined(OS_MACOSX) |
44 // Mac name code is in in platform_thread_mac.mm. | 44 // Mac name code is in in platform_thread_mac.mm. |
45 LazyInstance<ThreadLocalPointer<char>, | 45 LazyInstance<ThreadLocalPointer<char>, |
46 LeakyLazyInstanceTraits<ThreadLocalPointer<char> > > | 46 LeakyLazyInstanceTraits<ThreadLocalPointer<char> > > |
47 current_thread_name(LINKER_INITIALIZED); | 47 current_thread_name = LAZY_INSTANCE_INITIALIZER; |
48 #endif | 48 #endif |
49 | 49 |
50 struct ThreadParams { | 50 struct ThreadParams { |
51 PlatformThread::Delegate* delegate; | 51 PlatformThread::Delegate* delegate; |
52 bool joinable; | 52 bool joinable; |
53 }; | 53 }; |
54 | 54 |
55 void* ThreadFunc(void* params) { | 55 void* ThreadFunc(void* params) { |
56 ThreadParams* thread_params = static_cast<ThreadParams*>(params); | 56 ThreadParams* thread_params = static_cast<ThreadParams*>(params); |
57 PlatformThread::Delegate* delegate = thread_params->delegate; | 57 PlatformThread::Delegate* delegate = thread_params->delegate; |
(...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
257 // Mac OS X uses lower-level mach APIs | 257 // Mac OS X uses lower-level mach APIs |
258 | 258 |
259 // static | 259 // static |
260 void PlatformThread::SetThreadPriority(PlatformThreadHandle, ThreadPriority) { | 260 void PlatformThread::SetThreadPriority(PlatformThreadHandle, ThreadPriority) { |
261 // TODO(crogers): implement | 261 // TODO(crogers): implement |
262 NOTIMPLEMENTED(); | 262 NOTIMPLEMENTED(); |
263 } | 263 } |
264 #endif | 264 #endif |
265 | 265 |
266 } // namespace base | 266 } // namespace base |
OLD | NEW |