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 "base/debug/alias.h" | 7 #include "base/debug/alias.h" |
8 #include "base/debug/profiler.h" | 8 #include "base/debug/profiler.h" |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "base/threading/thread_id_name_manager.h" | 10 #include "base/threading/thread_id_name_manager.h" |
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
123 } | 123 } |
124 | 124 |
125 } // namespace | 125 } // namespace |
126 | 126 |
127 // static | 127 // static |
128 PlatformThreadId PlatformThread::CurrentId() { | 128 PlatformThreadId PlatformThread::CurrentId() { |
129 return GetCurrentThreadId(); | 129 return GetCurrentThreadId(); |
130 } | 130 } |
131 | 131 |
132 // static | 132 // static |
| 133 PlatformThreadRef PlatformThread::CurrentRef() { |
| 134 return PlatformThreadRef(GetCurrentThreadId()); |
| 135 } |
| 136 |
| 137 // static |
133 PlatformThreadHandle PlatformThread::CurrentHandle() { | 138 PlatformThreadHandle PlatformThread::CurrentHandle() { |
134 NOTIMPLEMENTED(); // See OpenThread() | 139 NOTIMPLEMENTED(); // See OpenThread() |
135 return PlatformThreadHandle(); | 140 return PlatformThreadHandle(); |
136 } | 141 } |
137 | 142 |
138 // static | 143 // static |
139 void PlatformThread::YieldCurrentThread() { | 144 void PlatformThread::YieldCurrentThread() { |
140 ::Sleep(0); | 145 ::Sleep(0); |
141 } | 146 } |
142 | 147 |
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
237 case kThreadPriority_RealtimeAudio: | 242 case kThreadPriority_RealtimeAudio: |
238 ::SetThreadPriority(handle.handle_, THREAD_PRIORITY_TIME_CRITICAL); | 243 ::SetThreadPriority(handle.handle_, THREAD_PRIORITY_TIME_CRITICAL); |
239 break; | 244 break; |
240 default: | 245 default: |
241 NOTREACHED() << "Unknown priority."; | 246 NOTREACHED() << "Unknown priority."; |
242 break; | 247 break; |
243 } | 248 } |
244 } | 249 } |
245 | 250 |
246 } // namespace base | 251 } // namespace base |
OLD | NEW |