ThreadPool

Inherited: None

Description

Public Methods

uint32_t

maxThreads () const

void

setMaxThreads (uint32_t number)

bool

waitForDone (int32_t msecs = -1)

Static Methods

uint32_t

optimalThreadCount ()

Methods Description

uint32_t ThreadPool::maxThreads () const

Returns the max number of threads allocated to work.

See also setMaxThreads().


uint32_t ThreadPool::optimalThreadCount ()

Returns the optimal thread count for the current system. This value is based on the number of CPU cores.


void ThreadPool::setMaxThreads (uint32_t number)

Sets the max number of threads allocated to work.

See also maxThreads().


bool ThreadPool::waitForDone (int32_t msecs = -1)

Waits up to msecs milliseconds for all threads to exit and removes all threads from the thread pool. Returns true if all threads were removed; otherwise it returns false. If msecs is -1 (the default), the timeout is ignored (waits for the last thread to exit).