Class ThreadPool¶
Defined in File ctpl.hpp
Class Documentation¶
-
class ThreadPool¶
The thread pool is configured with a number of threads and accepts lambdas as functions to run in one of the threads in the pool.
Public Functions
-
ThreadPool()¶
-
explicit ThreadPool(int thread_num)¶
-
ThreadPool(int thread_num, int queue_size)¶
-
ThreadPool(const ThreadPool&) = delete¶
-
ThreadPool(ThreadPool&&) = delete¶
-
ThreadPool &operator=(const ThreadPool&) = delete¶
-
ThreadPool &operator=(ThreadPool&&) = delete¶
-
~ThreadPool()¶
-
int getSize() const¶
-
int getIdle() const¶
-
std::thread &getThread(int i)¶
-
void resize(int thread_num)¶
-
void clearQueue()¶
-
std::function<void(int)> pop()¶
-
void stop(bool wait = false)¶
-
ThreadPool()¶