#include <ArTaskPool.h>
Public Methods | |
ArTaskPool () | |
Constructor. | |
virtual | ~ArTaskPool () |
Destructor. | |
virtual bool | runTask (ArFunctor *task) |
Run a function as a periodic task. | |
virtual bool | runTask (ArPeriodicTask *task) |
Run a periodic task. | |
virtual void | init (int minLimit=1, int maxLimit=0) |
Init the pool. | |
virtual void | uninit () |
Uninit the pool. Blocks till all tasks exit. | |
virtual void | forceUninit () |
Force all tasks to exit, then uninit the pool. | |
Static Public Methods | |
ArTaskPool * | getPool () |
Get a pointer to the 'single' instance of ArTaskPool. | |
void | setPool (ArTaskPool *pool) |
Set the pointer to the 'single' instance of ArTaskPool. | |
Static Public Attributes | |
ArTaskPool * | ourPool = 0 |
|
When tasks need to be run, threads will be created based upon the need. See setTaskMaxLimit() about this. If minLimit is greater than 0 and there are more threads than minLimit, the extra threads will be destroyed. If minLimit is 0, then all threads will be immediately destroyed after the task is done.
|