Ignore:
Timestamp:
Oct 20, 2012, 1:07:25 AM (12 years ago)
Author:
Torben Dannhauer
Message:
 
File:
1 edited

Legend:

Unmodified
Added
Removed
  • experimental/Threading/Threading/ChannelWorker.h

    r420 r421  
    33#include <osg/Referenced>
    44#include <OpenThreads/Thread>
    5 #include <OpenThreads/Barrier>
    65
    76
     
    98{
    109public:
    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.
    1312        virtual void run();
    1413        virtual int cancel();
    1514       
    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; } 
    1817
    1918private:
    20         int _numThreads;
    2119        bool _done;
    22         OpenThreads::Barrier& _syncBarrier;
    2320};
Note: See TracChangeset for help on using the changeset viewer.