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

Unified Diff: base/task_scheduler/scheduler_worker_pool_impl.h

Issue 2195813002: Migrate SchedulerWorkerPoolImpl to AtomicFlag (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: CR Feedback 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
« no previous file with comments | « no previous file | base/task_scheduler/scheduler_worker_pool_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/task_scheduler/scheduler_worker_pool_impl.h
diff --git a/base/task_scheduler/scheduler_worker_pool_impl.h b/base/task_scheduler/scheduler_worker_pool_impl.h
index 8c4f96ce39ff15431b19183a63a795e9e523e853..39ec9b8cfde4e515c4e40b9c17533c8fa577bcb7 100644
--- a/base/task_scheduler/scheduler_worker_pool_impl.h
+++ b/base/task_scheduler/scheduler_worker_pool_impl.h
@@ -17,6 +17,7 @@
#include "base/macros.h"
#include "base/memory/ref_counted.h"
#include "base/strings/string_piece.h"
+#include "base/synchronization/atomic_flag.h"
#include "base/synchronization/condition_variable.h"
#include "base/task_runner.h"
#include "base/task_scheduler/priority_queue.h"
@@ -161,12 +162,9 @@ class BASE_EXPORT SchedulerWorkerPoolImpl : public SchedulerWorkerPool {
// Signaled once JoinForTesting() has returned.
WaitableEvent join_for_testing_returned_;
- // Synchronizes access to |worker_detachment_allowed_|.
- SchedulerLock worker_detachment_allowed_lock_;
-
- // Indicates to the delegates that workers are permitted to detach their
+ // Indicates to the delegates that workers are not permitted to detach their
// threads.
- bool worker_detachment_allowed_ = true;
+ AtomicFlag worker_detachment_disallowed_;
#if DCHECK_IS_ON()
// Signaled when all workers have been created.
« no previous file with comments | « no previous file | base/task_scheduler/scheduler_worker_pool_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698