26 #include <condition_variable> 60 typedef std::function<void()>
task_t;
std::condition_variable m_tasks_condvar
Definition: thread_pool.hpp:152
thread_pool(std::size_t nb_threads)
std::size_t m_nb_threads
Definition: thread_pool.hpp:132
std::mutex m_tasks_mtx
Definition: thread_pool.hpp:147
thread_pool & operator=(const thread_pool &)=delete
assignment operator
std::function< void()> task_t
Definition: thread_pool.hpp:60
std::atomic< bool > m_should_stop
Definition: thread_pool.hpp:137
bool should_stop(void) const
Definition: io_service.hpp:48
void add_task(const task_t &task)
std::vector< std::thread > m_workers
Definition: thread_pool.hpp:127
thread_pool & operator<<(const task_t &task)
void set_nb_threads(std::size_t nb_threads)
Definition: thread_pool.hpp:37
std::queue< task_t > m_tasks
Definition: thread_pool.hpp:142
bool is_running(void) const