Changeset 421 for experimental/Threading/Threading/ChannelWorker.h
- Timestamp:
- Oct 20, 2012, 1:07:25 AM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
experimental/Threading/Threading/ChannelWorker.h
r420 r421 3 3 #include <osg/Referenced> 4 4 #include <OpenThreads/Thread> 5 #include <OpenThreads/Barrier>6 5 7 6 … … 9 8 { 10 9 public: 11 ChannelWorker( int numThreads, OpenThreads::Barrier& syncBarrier) ;12 ~ChannelWorker(); 10 ChannelWorker() ; 11 ~ChannelWorker(); //Destroying the thread object will implicit call cancel(), then the function will block until the thread has finished. 13 12 virtual void run(); 14 13 virtual int cancel(); 15 14 16 void setDone(bool done); 17 bool getDone() const { return _done; } 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; } 18 17 19 18 private: 20 int _numThreads;21 19 bool _done; 22 OpenThreads::Barrier& _syncBarrier;23 20 };
Note: See TracChangeset
for help on using the changeset viewer.