OLD | NEW |
1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef BASE_TASK_SCHEDULER_SCHEDULER_SINGLE_THREAD_TASK_RUNNER_MANAGER_H_ | 5 #ifndef BASE_TASK_SCHEDULER_SCHEDULER_SINGLE_THREAD_TASK_RUNNER_MANAGER_H_ |
6 #define BASE_TASK_SCHEDULER_SCHEDULER_SINGLE_THREAD_TASK_RUNNER_MANAGER_H_ | 6 #define BASE_TASK_SCHEDULER_SCHEDULER_SINGLE_THREAD_TASK_RUNNER_MANAGER_H_ |
7 | 7 |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
| 10 #include "base/atomicops.h" |
10 #include "base/base_export.h" | 11 #include "base/base_export.h" |
| 12 #include "base/logging.h" |
11 #include "base/macros.h" | 13 #include "base/macros.h" |
12 #include "base/memory/ref_counted.h" | 14 #include "base/memory/ref_counted.h" |
13 #include "base/task_scheduler/scheduler_lock.h" | 15 #include "base/task_scheduler/scheduler_lock.h" |
14 #include "base/task_scheduler/scheduler_worker_pool_params.h" | 16 #include "base/task_scheduler/scheduler_worker_pool_params.h" |
15 #include "base/task_scheduler/task_scheduler.h" | 17 #include "base/task_scheduler/task_scheduler.h" |
16 | 18 |
17 namespace base { | 19 namespace base { |
18 | 20 |
19 class TaskTraits; | 21 class TaskTraits; |
20 class SingleThreadTaskRunner; | 22 class SingleThreadTaskRunner; |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
52 const TaskScheduler::WorkerPoolIndexForTraitsCallback | 54 const TaskScheduler::WorkerPoolIndexForTraitsCallback |
53 worker_pool_index_for_traits_callback_; | 55 worker_pool_index_for_traits_callback_; |
54 TaskTracker* const task_tracker_; | 56 TaskTracker* const task_tracker_; |
55 DelayedTaskManager* const delayed_task_manager_; | 57 DelayedTaskManager* const delayed_task_manager_; |
56 | 58 |
57 // Synchronizes access to |workers_| and |worker_id_|. | 59 // Synchronizes access to |workers_| and |worker_id_|. |
58 SchedulerLock workers_lock_; | 60 SchedulerLock workers_lock_; |
59 std::vector<scoped_refptr<SchedulerWorker>> workers_; | 61 std::vector<scoped_refptr<SchedulerWorker>> workers_; |
60 int next_worker_id_ = 0; | 62 int next_worker_id_ = 0; |
61 | 63 |
| 64 #if DCHECK_IS_ON() |
| 65 subtle::Atomic32 workers_unregistered_during_join_ = 0; |
| 66 #endif |
| 67 |
62 DISALLOW_COPY_AND_ASSIGN(SchedulerSingleThreadTaskRunnerManager); | 68 DISALLOW_COPY_AND_ASSIGN(SchedulerSingleThreadTaskRunnerManager); |
63 }; | 69 }; |
64 | 70 |
65 } // namespace internal | 71 } // namespace internal |
66 } // namespace base | 72 } // namespace base |
67 | 73 |
68 #endif // BASE_TASK_SCHEDULER_SCHEDULER_SINGLE_THREAD_TASK_RUNNER_MANAGER_H_ | 74 #endif // BASE_TASK_SCHEDULER_SCHEDULER_SINGLE_THREAD_TASK_RUNNER_MANAGER_H_ |
OLD | NEW |