26 #include "glog/logging.h" 39 for (
int i = 0; i != num_threads; ++i) {
52 for (std::thread& thread : pool_) {
67 std::shared_ptr<Task> shared_task;
73 CHECK(insert_result.second) <<
"Schedule called twice";
74 shared_task = insert_result.first->second;
85 CHECK_NE(nice(10), -1);
88 std::shared_ptr<Task> task;
97 }
else if (!running_) {
void NotifyDependenciesCompleted(Task *task) EXCLUDES(mutex_) override
std::map< Task *, std::shared_ptr< Task > > tasks_not_ready_
void SetThreadPool(Task *task)
void Execute() EXCLUDES(mutex_)
void SetThreadPool(ThreadPoolInterface *thread_pool) EXCLUDES(mutex_)
std::deque< std::shared_ptr< Task > > task_queue_
std::weak_ptr< Task > Schedule(std::unique_ptr< Task > task) EXCLUDES(mutex_) override
Mutex::Locker MutexLocker
ThreadPool(int num_threads)