|
|
|
@ -50,7 +50,8 @@ namespace SceneUtil
|
|
|
|
|
|
|
|
|
|
/// Add a new work item to the back of the queue.
|
|
|
|
|
/// @par The work item's waitTillDone() method may be used by the caller to wait until the work is complete.
|
|
|
|
|
void addWorkItem(osg::ref_ptr<WorkItem> item);
|
|
|
|
|
/// @param front If true, add item to the front of the queue. If false (default), add to the back.
|
|
|
|
|
void addWorkItem(osg::ref_ptr<WorkItem> item, bool front=false);
|
|
|
|
|
|
|
|
|
|
/// 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.
|
|
|
|
@ -59,7 +60,7 @@ namespace SceneUtil
|
|
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
bool mIsReleased;
|
|
|
|
|
std::queue<osg::ref_ptr<WorkItem> > mQueue;
|
|
|
|
|
std::deque<osg::ref_ptr<WorkItem> > mQueue;
|
|
|
|
|
|
|
|
|
|
OpenThreads::Mutex mMutex;
|
|
|
|
|
OpenThreads::Condition mCondition;
|
|
|
|
|