Public Member Functions | |
void | run () |
void | add_worker () |
void | add_task (Task) |
bool | tryadd_task (Task) |
Public Attributes | |
std::list< Worker > | workers_list |
std::queue< Task > | tasks_queue |
std::condition_variable | condvar |
SpinLock | tasks_mtx |
Atomic | idle_workers = 0 |
Atomic | cur_workers = 1 |
Atomic | max_workers = 4 |
std::mutex | workers_mtx |
Static Public Attributes | |
static ThreadPool * | instance = nullptr |