Rev | Line | |
---|
[420] | 1 | #pragma once |
---|
| 2 | |
---|
| 3 | #include <osg/Referenced> |
---|
| 4 | #include <OpenThreads/Thread> |
---|
| 5 | |
---|
| 6 | |
---|
| 7 | class ChannelWorker : public osg::Referenced, public OpenThreads::Thread |
---|
| 8 | { |
---|
| 9 | public: |
---|
[421] | 10 | ChannelWorker() ; |
---|
| 11 | ~ChannelWorker(); //Destroying the thread object will implicit call cancel(), then the function will block until the thread has finished. |
---|
[420] | 12 | virtual void run(); |
---|
| 13 | virtual int cancel(); |
---|
| 14 | |
---|
[421] | 15 | void setDone(bool done); // sinbgals the thread to stop but returns immediately. Use cancel if you want to wait blocking until the thread is canceled. |
---|
| 16 | bool getDone() const { return _done; } |
---|
[420] | 17 | |
---|
| 18 | private: |
---|
| 19 | bool _done; |
---|
| 20 | }; |
---|
Note: See
TracBrowser
for help on using the repository browser.