Index: base/task_scheduler/task_tracker.h |
diff --git a/base/task_scheduler/task_tracker.h b/base/task_scheduler/task_tracker.h |
index 795ae4937058d0a8f24719b9ae0edfa3641e0b5f..b0bce5d50f0277e59ab105b0f2f3cdd08191ce1f 100644 |
--- a/base/task_scheduler/task_tracker.h |
+++ b/base/task_scheduler/task_tracker.h |
@@ -54,6 +54,8 @@ class BASE_EXPORT TaskTracker { |
} |
private: |
+ class State; |
+ |
// Called before WillPostTask() informs the tracing system that a task has |
// been posted. Updates |num_tasks_blocking_shutdown_| if necessary and |
// returns true if the current shutdown state allows the task to be posted. |
@@ -69,16 +71,22 @@ class BASE_EXPORT TaskTracker { |
// necessary. |
void AfterRunTask(TaskShutdownBehavior shutdown_behavior); |
- // Synchronizes access to all members. |
+ // Called when the number of tasks blocking shutdown becomes zero after |
+ // shutdown has started. |
+ void OnNumTasksBlockingShutdownIsZero(); |
robliao
2016/05/27 22:16:14
Alternately
OnBlockingShutdownTasksComplete
fdoray
2016/05/30 15:48:05
Done.
|
+ |
+ // Number of tasks blocking shutdown and boolean indicating whether shutdown |
+ // has started. |
+ const std::unique_ptr<State> state_; |
+ |
+ // Synchronizes access to all members below. |
mutable SchedulerLock lock_; |
- // Condition variable signaled when |num_tasks_blocking_shutdown_| reaches |
- // zero while shutdown is in progress. Null if shutdown isn't in progress. |
+ // Condition variable signaled when the number of tasks blocking shutdown |
+ // reaches zero while shutdown is in progress. Null if shutdown isn't in |
+ // progress. |
std::unique_ptr<ConditionVariable> shutdown_cv_; |
- // Number of tasks blocking shutdown. |
- size_t num_tasks_blocking_shutdown_ = 0; |
- |
// Number of BLOCK_SHUTDOWN tasks posted during shutdown. |
HistogramBase::Sample num_block_shutdown_tasks_posted_during_shutdown_ = 0; |