is the top manager of everything. Give the tasks to it and it will be performed in time. Note that no notification is done when the task is done. It's up to the user of the class to implement such things in the ThreadTask.
More...
List of all members.
Detailed Description
is the top manager of everything. Give the tasks to it and it will be performed in time. Note that no notification is done when the task is done. It's up to the user of the class to implement such things in the ThreadTask.
The object can handle multiple queues. This is mostly intersting when you want to ensure that a shared resource is always accessed single threaded, but without using syncronization.
Member Enumeration Documentation
- Enumerator:
| MultiThread |
|
| SingleThread |
|
| Manual |
|
Constructor & Destructor Documentation
| Threads::WorkManager::WorkManager |
( |
int |
nrthreads = -1 |
) |
|
| Threads::WorkManager::~WorkManager |
( |
|
) |
|
Member Function Documentation
| int Threads::WorkManager::addQueue |
( |
QueueType |
type |
) |
|
Manual queues will not be executed automaticall, only at executeQueue.
- Returns:
- queid
| void Threads::WorkManager::addWork |
( |
SequentialTask * |
, |
|
|
CallBack * |
finished, |
|
|
int |
queueid, |
|
|
bool |
putfirstinline, |
|
|
bool |
manage | |
|
) |
| | |
Managed by caller if manage flag is false.
| static int Threads::WorkManager::cDefaultQueueID |
( |
|
) |
[inline, static] |
| void Threads::WorkManager::executeQueue |
( |
int |
queueid |
) |
|
Runs all jobs in a que. Only for manual queues
| int Threads::WorkManager::nrThreads |
( |
|
) |
const [inline] |
When a work is sumbmitted with a callback, the callback is called with a callbacker. If called from the callback and the callbacker is non-zero, a pointer to the work that was completed is returned. If not possible, a zero pointer will be returned.
| int Threads::WorkManager::queueSize |
( |
int |
queueid |
) |
const |
| int Threads::WorkManager::queueSizeNoLock |
( |
int |
queueid |
) |
const [protected] |
| void Threads::WorkManager::removeQueue |
( |
int |
queueid, |
|
|
bool |
finishall | |
|
) |
| | |
Removes queue. If finishall is true, all work in the queue will be finished.
Removes the task from queue and stop it if allready running. If task is managed, it will be deleted.
- Returns:
- true if the task was removed before it had started.
| int Threads::WorkManager::reportFinishedAndAskForMore |
( |
WorkThread * |
, |
|
|
int |
oldqueueid | |
|
) |
| | [protected] |
Friends And Related Function Documentation
friend class WorkThread [friend] |
Member Data Documentation