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

Unified Diff: base/threading/simple_thread.cc

Issue 1180693002: Update from https://crrev.com/333737 (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: rebased Created 5 years, 6 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/simple_thread.h ('k') | base/threading/thread.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/threading/simple_thread.cc
diff --git a/base/threading/simple_thread.cc b/base/threading/simple_thread.cc
index 1bc31135941f0169603924dfa0d8d3542e6ab650..7059ceab76661428a3a4e9f7eb124e524b162ebe 100644
--- a/base/threading/simple_thread.cc
+++ b/base/threading/simple_thread.cc
@@ -29,7 +29,13 @@ SimpleThread::~SimpleThread() {
void SimpleThread::Start() {
DCHECK(!HasBeenStarted()) << "Tried to Start a thread multiple times.";
- bool success = PlatformThread::Create(options_.stack_size(), this, &thread_);
+ bool success;
+ if (options_.priority() == ThreadPriority::NORMAL) {
+ success = PlatformThread::Create(options_.stack_size(), this, &thread_);
+ } else {
+ success = PlatformThread::CreateWithPriority(options_.stack_size(), this,
+ &thread_, options_.priority());
+ }
DCHECK(success);
base::ThreadRestrictions::ScopedAllowWait allow_wait;
event_.Wait(); // Wait for the thread to complete initialization.
« no previous file with comments | « base/threading/simple_thread.h ('k') | base/threading/thread.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698