15 #ifndef ABSL_SYNCHRONIZATION_INTERNAL_THREAD_POOL_H_ 16 #define ABSL_SYNCHRONIZATION_INTERNAL_THREAD_POOL_H_ 29 namespace synchronization_internal {
35 for (
int i = 0;
i < num_threads; ++
i) {
57 assert(func !=
nullptr);
64 return !queue_.empty();
69 std::function<void()> func;
76 if (func ==
nullptr) {
84 std::queue<std::function<void()>> queue_
GUARDED_BY(mu_);
91 #endif // ABSL_SYNCHRONIZATION_INTERNAL_THREAD_POOL_H_ #define EXCLUSIVE_LOCKS_REQUIRED(...)
bool WorkAvailable() const EXCLUSIVE_LOCKS_REQUIRED(mu_)
std::queue< std::function< void()> > queue_ GUARDED_BY(mu_)
ThreadPool & operator=(const ThreadPool &)=delete
std::vector< std::thread > threads_
ThreadPool(int num_threads)
void Await(const Condition &cond)
constexpr absl::remove_reference_t< T > && move(T &&t) noexcept
void Schedule(std::function< void()> func)