ThreadPool.free

Frees all resources allocated for pool.

If immediate is TRUE, no new task is processed for pool. Otherwise pool is not freed before the last task is processed. Note however, that no thread of this pool is interrupted while processing a task. Instead at least all still running threads can finish their tasks before the pool is freed.

If wait_ is TRUE, the functions does not return before all tasks to be processed (dependent on immediate, whether all or only the currently running) are ready. Otherwise the function returns immediately.

After calling this function pool must not be used anymore.

class ThreadPool
void
free
(,
bool wait
)

Parameters

immediate bool

should pool shut down immediately?

wait bool

should the function wait for all tasks to be finished?