Chromium Code Reviews| Index: base/task_scheduler/task_tracker.cc |
| diff --git a/base/task_scheduler/task_tracker.cc b/base/task_scheduler/task_tracker.cc |
| index a8fbfcac856d1ccca41dc61a0921841d52102b7f..a209a25e4ad8cc9ece50db6aa46a385309398d7c 100644 |
| --- a/base/task_scheduler/task_tracker.cc |
| +++ b/base/task_scheduler/task_tracker.cc |
| @@ -215,7 +215,7 @@ void TaskTracker::Shutdown() { |
| void TaskTracker::Flush() { |
| AutoSchedulerLock auto_lock(flush_lock_); |
| - while (subtle::NoBarrier_Load(&num_pending_undelayed_tasks_) != 0 && |
| + while (subtle::Acquire_Load(&num_pending_undelayed_tasks_) != 0 && |
|
robliao
2017/05/02 14:23:20
What was the failure that caused this?
robliao
2017/05/02 15:44:47
Offline Discussion: The Acquire here is probably n
gab
2017/05/02 20:26:27
My thoughts (no action required):
So the problem
fdoray
2017/05/03 13:17:28
Updating comment in header file: Done.
|
| !IsShutdownComplete()) { |
| flush_cv_->Wait(); |
| } |
| @@ -484,7 +484,7 @@ void TaskTracker::OnBlockingShutdownTasksComplete() { |
| void TaskTracker::DecrementNumPendingUndelayedTasks() { |
| const auto new_num_pending_undelayed_tasks = |
| - subtle::NoBarrier_AtomicIncrement(&num_pending_undelayed_tasks_, -1); |
| + subtle::Barrier_AtomicIncrement(&num_pending_undelayed_tasks_, -1); |
|
robliao
2017/05/02 14:23:20
Is this barrier actually necessary? What other mem
robliao
2017/05/02 15:44:48
Offline discussion: The memory writes of the task
|
| DCHECK_GE(new_num_pending_undelayed_tasks, 0); |
| if (new_num_pending_undelayed_tasks == 0) { |
| AutoSchedulerLock auto_lock(flush_lock_); |