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

Unified Diff: base/task_scheduler/task_tracker.cc

Issue 2857613002: Synchronize memory in TaskTracker::Flush(). (Closed)
Patch Set: update_comment_in_header_file Created 3 years, 8 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/task_scheduler/task_tracker.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 &&
!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);
DCHECK_GE(new_num_pending_undelayed_tasks, 0);
if (new_num_pending_undelayed_tasks == 0) {
AutoSchedulerLock auto_lock(flush_lock_);
« no previous file with comments | « base/task_scheduler/task_tracker.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698