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

Unified Diff: base/threading/thread.cc

Issue 12741012: base: Support setting thread priorities generically. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove static initializers. Created 7 years, 7 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
« no previous file with comments | « base/threading/thread.h ('k') | base/threading/thread_restrictions.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/threading/thread.cc
diff --git a/base/threading/thread.cc b/base/threading/thread.cc
index 35e88a70569a2b6dfcae8122bab5290d57ed140a..8b3dc2b006a7c6af2cb94dc7ff2b4f642a2366d8 100644
--- a/base/threading/thread.cc
+++ b/base/threading/thread.cc
@@ -148,6 +148,13 @@ bool Thread::IsRunning() const {
return running_;
}
+void Thread::SetPriority(ThreadPriority priority) {
+ // The thread must be started (and id known) for this to be
+ // compatible with all platforms.
+ DCHECK_NE(thread_id_, kInvalidThreadId);
+ PlatformThread::SetThreadPriority(thread_, priority);
+}
+
void Thread::Run(MessageLoop* message_loop) {
message_loop->Run();
}
« no previous file with comments | « base/threading/thread.h ('k') | base/threading/thread_restrictions.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698