Chromium Code Reviews| 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 4693d635045a45c82c116008986095d9700c8680..66a27668d7d4595337b5a160e4e9168e78fa781a 100644 |
| --- a/base/task_scheduler/scheduler_worker_pool_impl.h |
| +++ b/base/task_scheduler/scheduler_worker_pool_impl.h |
| @@ -17,7 +17,6 @@ |
| #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_scheduler/priority_queue.h" |
| #include "base/task_scheduler/scheduler_lock.h" |
| @@ -97,14 +96,6 @@ class BASE_EXPORT SchedulerWorkerPoolImpl : public SchedulerWorkerPool { |
| // allowed to complete their execution. This can only be called once. |
| void JoinForTesting(); |
| - // Disallows worker thread detachment. If the suggested reclaim time is not |
| - // TimeDelta::Max(), then the test should call this before the detach code can |
| - // run. The safest place to do this is before the a set of work is dispatched |
| - // (the worker pool is idle and steady state) or before the last |
| - // synchronization point for all workers (all threads are busy and can't be |
| - // reclaimed). |
| - void DisallowWorkerDetachmentForTesting(); |
|
robliao
2017/01/17 19:01:27
From what I can tell, we need to disallow detachme
fdoray
2017/01/17 20:43:13
After JoinForTesting() returns, the thread is eith
robliao
2017/01/17 21:09:03
Can JoinForTesting call DisallowWorkerDetachmentFo
fdoray
2017/01/17 23:51:00
The hard part is making sure that DisallowWorkerDe
robliao
2017/01/18 00:58:19
With this code change, you can now call it at any
fdoray
2017/01/19 16:37:40
What would be the benefit of calling DisallowWorke
robliao
2017/01/19 16:57:29
The intent here would be to first do a disallow de
|
| - |
| // Returns the number of workers alive in this worker pool. The value may |
| // change if workers are woken up or detached during this call. |
| size_t NumberOfAliveWorkersForTesting(); |
| @@ -139,9 +130,6 @@ class BASE_EXPORT SchedulerWorkerPoolImpl : public SchedulerWorkerPool { |
| // Removes |worker| from |idle_workers_stack_|. |
| void RemoveFromIdleWorkersStack(SchedulerWorker* worker); |
| - // Returns true if worker thread detachment is permitted. |
| - bool CanWorkerDetachForTesting(); |
| - |
| // The name of this worker pool, used to label its worker threads. |
| const std::string name_; |
| @@ -182,10 +170,6 @@ class BASE_EXPORT SchedulerWorkerPoolImpl : public SchedulerWorkerPool { |
| // Signaled once JoinForTesting() has returned. |
| WaitableEvent join_for_testing_returned_; |
| - // Indicates to the delegates that workers are not permitted to detach their |
| - // threads. |
| - AtomicFlag worker_detachment_disallowed_; |
| - |
| #if DCHECK_IS_ON() |
| // Signaled when all workers have been created. |
| WaitableEvent workers_created_; |