thread pool class.
More...
#include <threadpool.hpp>
|
| | ThreadPool (int workers=std::max(int(std::thread::hardware_concurrency()), 1)) |
| | create thread pool.
|
| |
| | ~ThreadPool () |
| | destroy thread pool.
|
| |
| template<class Function , class... Args> |
| void | push (Function &&func, Args &&... args) |
| | push a job to the work queue.
|
| |
| size_t | size () |
| | return thread pool size.
|
| |
◆ ThreadPool()
| ThreadPool::ThreadPool |
( |
int | workers = std::max (int (std::thread::hardware_concurrency ()), 1) | ) |
|
create thread pool.
- Parameters
-
| workers | number of worker threads. |
◆ ~ThreadPool()
| ThreadPool::~ThreadPool |
( |
| ) |
|
◆ push()
template<class Function , class... Args>
| void join::ThreadPool::push |
( |
Function && | func, |
|
|
Args &&... | args ) |
|
inline |
push a job to the work queue.
◆ size()
| size_t ThreadPool::size |
( |
| ) |
|
◆ WorkerThread
friendship with worker thread.
The documentation for this class was generated from the following files: