1 #ifndef OPENMW_COMPONENTS_SCENEUTIL_WORKQUEUE_H
2 #define OPENMW_COMPONENTS_SCENEUTIL_WORKQUEUE_H
4 #include <OpenThreads/Atomic>
5 #include <OpenThreads/Mutex>
6 #include <OpenThreads/Condition>
7 #include <OpenThreads/Thread>
9 #include <osg/Referenced>
10 #include <osg/ref_ptr>
54 void addWorkItem(osg::ref_ptr<WorkItem> item,
bool front=
false);
63 std::deque<osg::ref_ptr<WorkItem> >
mQueue;
Internally used by WorkQueue.
Definition: workqueue.hpp:72
virtual void run()
Definition: workqueue.cpp:108
A work queue that users can push work items onto, to be completed by one or more background threads...
Definition: workqueue.hpp:45
~WorkQueue()
Definition: workqueue.cpp:53
std::vector< WorkThread * > mThreads
Definition: workqueue.hpp:68
WorkQueue * mWorkQueue
Definition: workqueue.hpp:80
WorkThread(WorkQueue *workQueue)
Definition: workqueue.cpp:103
WorkItem()
Definition: workqueue.cpp:29
void waitTillDone()
Wait until the work is completed. Usually called from the main thread.
Definition: workqueue.cpp:8
osg::ref_ptr< WorkItem > removeWorkItem()
Definition: workqueue.cpp:86
bool mIsReleased
Definition: workqueue.hpp:62
OpenThreads::Mutex mMutex
Definition: workqueue.hpp:36
Definition: workqueue.hpp:17
OpenThreads::Condition mCondition
Definition: workqueue.hpp:66
bool isDone() const
Definition: workqueue.cpp:37
OpenThreads::Mutex mMutex
Definition: workqueue.hpp:65
virtual void doWork()
Override in a derived WorkItem to perform actual work.
Definition: workqueue.hpp:24
OpenThreads::Atomic mDone
Definition: workqueue.hpp:35
WorkQueue(int numWorkerThreads=1)
Definition: workqueue.cpp:42
void addWorkItem(osg::ref_ptr< WorkItem > item, bool front=false)
Definition: workqueue.cpp:70
OpenThreads::Condition mCondition
Definition: workqueue.hpp:37
virtual ~WorkItem()
Definition: workqueue.cpp:33
std::deque< osg::ref_ptr< WorkItem > > mQueue
Definition: workqueue.hpp:63
void signalDone()
Internal use by the WorkQueue.
Definition: workqueue.cpp:20