A work queue that users can push work items onto, to be completed by one or more background threads.
More...
#include <workqueue.hpp>
A work queue that users can push work items onto, to be completed by one or more background threads.
- Note
- Work items will be processed in the order that they were given in, however if multiple work threads are involved then it is possible for a later item to complete before earlier items.
SceneUtil::WorkQueue::WorkQueue |
( |
int |
numWorkerThreads = 1 | ) |
|
SceneUtil::WorkQueue::~WorkQueue |
( |
| ) |
|
void SceneUtil::WorkQueue::addWorkItem |
( |
osg::ref_ptr< WorkItem > |
item, |
|
|
bool |
front = false |
|
) |
| |
Add a new work item to the back of the queue.
- The work item's waitTillDone() method may be used by the caller to wait until the work is complete.
- Parameters
-
front | If true, add item to the front of the queue. If false (default), add to the back. |
osg::ref_ptr< WorkItem > SceneUtil::WorkQueue::removeWorkItem |
( |
| ) |
|
Get the next work item from the front of the queue. If the queue is empty, waits until a new item is added. If the workqueue is in the process of being destroyed, may return NULL.
- Used internally by the WorkThread.
OpenThreads::Condition SceneUtil::WorkQueue::mCondition |
|
private |
bool SceneUtil::WorkQueue::mIsReleased |
|
private |
OpenThreads::Mutex SceneUtil::WorkQueue::mMutex |
|
private |
std::deque<osg::ref_ptr<WorkItem> > SceneUtil::WorkQueue::mQueue |
|
private |
std::vector<WorkThread*> SceneUtil::WorkQueue::mThreads |
|
private |
The documentation for this class was generated from the following files:
- /home/travis/build/OpenMW/openmw/components/sceneutil/workqueue.hpp
- /home/travis/build/OpenMW/openmw/components/sceneutil/workqueue.cpp