Class ThreadPool
Defined in File ThreadPool.hpp
Class Documentation
-
class ThreadPool
Thread pool singleton.
Public Functions
Place a task into the queue with an expected return value.
- Parameters:
func – The task to execute
args – The arguments to the task function
- Throws:
BadInitStateException – If the pool is not running
- Returns:
A future that will be fulfilled when the task completes
-
template<typename F, typename ...Args>
inline std::stop_source ExecContinuous(F func, Args... args) Run a looping function on the thread pool that can be signaled to stop.
Note
All functions will be automatically signaled to stop when the pool is
- Parameters:
func – The function to execute
args – The arguments to the task function
- Throws:
BadInitStateException – If the pool is not running
- Returns:
An object by which the function can be requested to stop
Public Static Functions
-
static ThreadPool &Get()
Get the instance and create one if there isn’t one.
- Returns:
The instance