7 #ifndef PACKAGER_FILE_THREAD_POOL_H_
8 #define PACKAGER_FILE_THREAD_POOL_H_
13 #include <absl/base/thread_annotations.h>
14 #include <absl/synchronization/mutex.h>
16 #include <packager/macros/classes.h>
26 typedef std::function<void()> Task;
46 absl::CondVar tasks_available_ ABSL_GUARDED_BY(mutex_);
47 std::queue<Task> tasks_ ABSL_GUARDED_BY(mutex_);
48 size_t num_idle_threads_ ABSL_GUARDED_BY(mutex_);
49 bool terminated_ ABSL_GUARDED_BY(mutex_);
void PostTask(const Task &task)
All the methods that are virtual are virtual for mocking.