free

fun free(immediate: Boolean, wait: Boolean)

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, this function does not return before all tasks to be processed (dependent on @immediate, whether all or only the currently running) are ready. Otherwise this function returns immediately.

After calling this function @pool must not be used anymore.

Parameters

immediate

should @pool shut down immediately?

wait

should the function wait for all tasks to be finished?