Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1112)

Unified Diff: base/threading/platform_thread_win.cc

Issue 12741012: base: Support setting thread priorities generically. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase. Created 7 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: base/threading/platform_thread_win.cc
diff --git a/base/threading/platform_thread_win.cc b/base/threading/platform_thread_win.cc
index 9e877b32f9e1e630ce31c164f5e58680b898e5f7..6a7dedc978e33c2af7460ed4b4b8b8dd893b176f 100644
--- a/base/threading/platform_thread_win.cc
+++ b/base/threading/platform_thread_win.cc
@@ -153,7 +153,7 @@ bool PlatformThread::CreateWithPriority(size_t stack_size, Delegate* delegate,
ThreadPriority priority) {
bool result = Create(stack_size, delegate, thread_handle);
if (result)
- SetThreadPriority(*thread_handle, priority);
+ SetThreadPriority(*thread_handle, 0, priority);
return result;
}
@@ -191,6 +191,7 @@ void PlatformThread::Join(PlatformThreadHandle thread_handle) {
// static
void PlatformThread::SetThreadPriority(PlatformThreadHandle handle,
+ PlatformThreadId,
ThreadPriority priority) {
switch (priority) {
case kThreadPriority_Normal:
@@ -199,6 +200,9 @@ void PlatformThread::SetThreadPriority(PlatformThreadHandle handle,
case kThreadPriority_RealtimeAudio:
::SetThreadPriority(handle, THREAD_PRIORITY_TIME_CRITICAL);
break;
+ default:
+ NOTREACHED() << "Unknown priority.";
+ break;
}
}

Powered by Google App Engine
This is Rietveld 408576698