 Chromium Code Reviews
 Chromium Code Reviews Issue 2414063002:
  TaskScheduler: Always remove SchedulerWorker from idle stack on wake up.  (Closed)
    
  
    Issue 2414063002:
  TaskScheduler: Always remove SchedulerWorker from idle stack on wake up.  (Closed) 
  | OLD | NEW | 
|---|---|
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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_WORKER_POOL_IMPL_H_ | 5 #ifndef BASE_TASK_SCHEDULER_SCHEDULER_WORKER_POOL_IMPL_H_ | 
| 6 #define BASE_TASK_SCHEDULER_SCHEDULER_WORKER_POOL_IMPL_H_ | 6 #define BASE_TASK_SCHEDULER_SCHEDULER_WORKER_POOL_IMPL_H_ | 
| 7 | 7 | 
| 8 #include <stddef.h> | 8 #include <stddef.h> | 
| 9 | 9 | 
| 10 #include <memory> | 10 #include <memory> | 
| (...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 107 io_restriction, | 107 io_restriction, | 
| 108 const TimeDelta& suggested_reclaim_time, | 108 const TimeDelta& suggested_reclaim_time, | 
| 109 TaskTracker* task_tracker, | 109 TaskTracker* task_tracker, | 
| 110 DelayedTaskManager* delayed_task_manager); | 110 DelayedTaskManager* delayed_task_manager); | 
| 111 | 111 | 
| 112 bool Initialize( | 112 bool Initialize( | 
| 113 ThreadPriority priority_hint, | 113 ThreadPriority priority_hint, | 
| 114 size_t max_threads, | 114 size_t max_threads, | 
| 115 const ReEnqueueSequenceCallback& re_enqueue_sequence_callback); | 115 const ReEnqueueSequenceCallback& re_enqueue_sequence_callback); | 
| 116 | 116 | 
| 117 // Wakes up the last worker from this worker pool to go idle, if any. | 117 // Wakes up |worker| and removes it from the idle stack. | 
| 
robliao
2016/10/13 17:38:40
Leave both of these comments like they were before
 
fdoray
2016/10/13 18:46:55
Done.
 | |
| 118 void WakeUpWorker(SchedulerWorker* worker); | |
| 119 | |
| 120 // Wakes up and removes from the idle stack the last worker from this worker | |
| 121 // pool to go idle, if any. | |
| 118 void WakeUpOneWorker(); | 122 void WakeUpOneWorker(); | 
| 119 | 123 | 
| 120 // Adds |worker| to |idle_workers_stack_|. | 124 // Adds |worker| to |idle_workers_stack_|. | 
| 121 void AddToIdleWorkersStack(SchedulerWorker* worker); | 125 void AddToIdleWorkersStack(SchedulerWorker* worker); | 
| 122 | 126 | 
| 123 // Peeks from |idle_workers_stack_|. | 127 // Peeks from |idle_workers_stack_|. | 
| 124 const SchedulerWorker* PeekAtIdleWorkersStack() const; | 128 const SchedulerWorker* PeekAtIdleWorkersStack() const; | 
| 125 | 129 | 
| 126 // Removes |worker| from |idle_workers_stack_|. | 130 // Removes |worker| from |idle_workers_stack_|. | 
| 127 void RemoveFromIdleWorkersStack(SchedulerWorker* worker); | 131 void RemoveFromIdleWorkersStack(SchedulerWorker* worker); | 
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 196 TaskTracker* const task_tracker_; | 200 TaskTracker* const task_tracker_; | 
| 197 DelayedTaskManager* const delayed_task_manager_; | 201 DelayedTaskManager* const delayed_task_manager_; | 
| 198 | 202 | 
| 199 DISALLOW_COPY_AND_ASSIGN(SchedulerWorkerPoolImpl); | 203 DISALLOW_COPY_AND_ASSIGN(SchedulerWorkerPoolImpl); | 
| 200 }; | 204 }; | 
| 201 | 205 | 
| 202 } // namespace internal | 206 } // namespace internal | 
| 203 } // namespace base | 207 } // namespace base | 
| 204 | 208 | 
| 205 #endif // BASE_TASK_SCHEDULER_SCHEDULER_WORKER_POOL_IMPL_H_ | 209 #endif // BASE_TASK_SCHEDULER_SCHEDULER_WORKER_POOL_IMPL_H_ | 
| OLD | NEW |