| 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 #include "base/task_scheduler/scheduler_thread_pool_impl.h" | 5 #include "base/task_scheduler/scheduler_thread_pool_impl.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <algorithm> | 9 #include <algorithm> |
| 10 #include <utility> | 10 #include <utility> |
| (...skipping 477 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 488 SchedulerThreadPoolImpl::SchedulerThreadPoolImpl( | 488 SchedulerThreadPoolImpl::SchedulerThreadPoolImpl( |
| 489 StringPiece name, | 489 StringPiece name, |
| 490 IORestriction io_restriction, | 490 IORestriction io_restriction, |
| 491 TaskTracker* task_tracker, | 491 TaskTracker* task_tracker, |
| 492 DelayedTaskManager* delayed_task_manager) | 492 DelayedTaskManager* delayed_task_manager) |
| 493 : name_(name.as_string()), | 493 : name_(name.as_string()), |
| 494 io_restriction_(io_restriction), | 494 io_restriction_(io_restriction), |
| 495 idle_worker_threads_stack_lock_(shared_priority_queue_.container_lock()), | 495 idle_worker_threads_stack_lock_(shared_priority_queue_.container_lock()), |
| 496 idle_worker_threads_stack_cv_for_testing_( | 496 idle_worker_threads_stack_cv_for_testing_( |
| 497 idle_worker_threads_stack_lock_.CreateConditionVariable()), | 497 idle_worker_threads_stack_lock_.CreateConditionVariable()), |
| 498 join_for_testing_returned_(true, false), | 498 join_for_testing_returned_(WaitableEvent::ResetPolicy::MANUAL, |
| 499 WaitableEvent::InitialState::NOT_SIGNALED), |
| 499 #if DCHECK_IS_ON() | 500 #if DCHECK_IS_ON() |
| 500 threads_created_(true, false), | 501 threads_created_(WaitableEvent::ResetPolicy::MANUAL, |
| 502 WaitableEvent::InitialState::NOT_SIGNALED), |
| 501 #endif | 503 #endif |
| 502 task_tracker_(task_tracker), | 504 task_tracker_(task_tracker), |
| 503 delayed_task_manager_(delayed_task_manager) { | 505 delayed_task_manager_(delayed_task_manager) { |
| 504 DCHECK(task_tracker_); | 506 DCHECK(task_tracker_); |
| 505 DCHECK(delayed_task_manager_); | 507 DCHECK(delayed_task_manager_); |
| 506 } | 508 } |
| 507 | 509 |
| 508 bool SchedulerThreadPoolImpl::Initialize( | 510 bool SchedulerThreadPoolImpl::Initialize( |
| 509 ThreadPriority thread_priority, | 511 ThreadPriority thread_priority, |
| 510 size_t max_threads, | 512 size_t max_threads, |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 554 } | 556 } |
| 555 | 557 |
| 556 void SchedulerThreadPoolImpl::RemoveFromIdleWorkerThreadsStack( | 558 void SchedulerThreadPoolImpl::RemoveFromIdleWorkerThreadsStack( |
| 557 SchedulerWorkerThread* worker_thread) { | 559 SchedulerWorkerThread* worker_thread) { |
| 558 AutoSchedulerLock auto_lock(idle_worker_threads_stack_lock_); | 560 AutoSchedulerLock auto_lock(idle_worker_threads_stack_lock_); |
| 559 idle_worker_threads_stack_.Remove(worker_thread); | 561 idle_worker_threads_stack_.Remove(worker_thread); |
| 560 } | 562 } |
| 561 | 563 |
| 562 } // namespace internal | 564 } // namespace internal |
| 563 } // namespace base | 565 } // namespace base |
| OLD | NEW |