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

Unified Diff: base/task_scheduler/task_tracker.cc

Issue 2161213002: TaskScheduler: Bump thread priority during shutdown. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 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/task_scheduler/task_tracker.cc
diff --git a/base/task_scheduler/task_tracker.cc b/base/task_scheduler/task_tracker.cc
index 8817baa04701088ece63b91005c68fe19ddca6e3..4c0b3f3edc4d94dc5f34c4a51b7f10622a82cb37 100644
--- a/base/task_scheduler/task_tracker.cc
+++ b/base/task_scheduler/task_tracker.cc
@@ -219,11 +219,19 @@ bool TaskTracker::IsShutdownComplete() const {
return shutdown_event_ && shutdown_event_->IsSignaled();
}
-bool TaskTracker::IsShuttingDownForTesting() const {
+bool TaskTracker::IsShutdownInProgress() const {
AutoSchedulerLock auto_lock(shutdown_lock_);
return shutdown_event_ && !shutdown_event_->IsSignaled();
}
+void TaskTracker::SetIsShutdownInProgressForTesting() {
+ AutoSchedulerLock auto_lock(shutdown_lock_);
+ DCHECK(!shutdown_event_);
+ shutdown_event_.reset(
+ new WaitableEvent(WaitableEvent::ResetPolicy::MANUAL,
robliao 2016/07/19 22:41:28 Unify this event creation with the one in Shutdown
fdoray 2016/07/20 18:22:21 n/a
+ WaitableEvent::InitialState::NOT_SIGNALED));
+}
+
bool TaskTracker::BeforePostTask(TaskShutdownBehavior shutdown_behavior) {
if (shutdown_behavior == TaskShutdownBehavior::BLOCK_SHUTDOWN) {
// BLOCK_SHUTDOWN tasks block shutdown between the moment they are posted

Powered by Google App Engine
This is Rietveld 408576698