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 "base/debug/alias.h" | 7 #include "base/debug/alias.h" |
8 #include "base/logging.h" | 8 #include "base/logging.h" |
9 #include "base/threading/thread_local.h" | 9 #include "base/threading/thread_local.h" |
10 #include "base/threading/thread_restrictions.h" | 10 #include "base/threading/thread_restrictions.h" |
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
150 | 150 |
151 // Wait for the thread to exit. It should already have terminated but make | 151 // Wait for the thread to exit. It should already have terminated but make |
152 // sure this assumption is valid. | 152 // sure this assumption is valid. |
153 DWORD result = WaitForSingleObject(thread_handle, INFINITE); | 153 DWORD result = WaitForSingleObject(thread_handle, INFINITE); |
154 DCHECK_EQ(WAIT_OBJECT_0, result); | 154 DCHECK_EQ(WAIT_OBJECT_0, result); |
155 | 155 |
156 CloseHandle(thread_handle); | 156 CloseHandle(thread_handle); |
157 } | 157 } |
158 | 158 |
159 // static | 159 // static |
160 void PlatformThread::SetThreadPriority(PlatformThreadHandle, ThreadPriority) { | 160 void PlatformThread::SetThreadPriority(PlatformThreadHandle handle, |
161 // TODO(crogers): implement | 161 ThreadPriority priority) { |
162 NOTIMPLEMENTED(); | 162 switch (priority) { |
163 case kThreadPriority_Normal: | |
164 ::SetThreadPriority(handle, THREAD_PRIORITY_NORMAL); | |
165 break; | |
166 case kThreadPriority_RealtimeAudio: | |
willchan no longer on Chromium
2011/10/25 20:26:27
I'm disappointed that kThreadPriority_RealtimeAudi
| |
167 ::SetThreadPriority(handle, THREAD_PRIORITY_TIME_CRITICAL); | |
168 break; | |
169 default: | |
170 NOTIMPLEMENTED(); | |
171 break; | |
172 } | |
163 } | 173 } |
164 | 174 |
165 } // namespace base | 175 } // namespace base |
OLD | NEW |