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