#include </opt/build/repo/nap/utility/src/utility/threading.h>
Public Member Functions | |
| WorkerThread () | |
| WorkerThread (bool blocking, int maxQueueItems=20) | |
| virtual | ~WorkerThread () |
| void | enqueue (TaskQueue::Task task) |
| void | start () |
| void | stop () |
| bool | isRunning () |
| virtual void | loop () |
A single thread that runs its own task queue
| WorkerThread | ( | ) |
Explicit default constructor
| WorkerThread | ( | bool | blocking, |
| int | maxQueueItems = 20 |
||
| ) |
| blocking | when true: the threads blocks and waits for enqueued tasks to perform, false: the threads runs through the loop as fast as possible and emits 'execute' every iteration |
| maxQueueItems | the maximum number of items in the task queue |
|
virtual |
| void enqueue | ( | TaskQueue::Task | task | ) |
enqueues a task to be performed on this thread
| bool isRunning | ( | ) |
Returns wether the thread is running and not shutting down.
|
virtual |
Overwrite this method to specify behaviour to be executed each loop after processing the task queue.
| void start | ( | ) |
Start the thread and the thread loop.
| void stop | ( | ) |
Stop the thread loop and join the thread.