source: experimental/Threading/Threading/ChannelWorker.h @ 421

Last change on this file since 421 was 421, checked in by Torben Dannhauer, 12 years ago
File size: 598 bytes
Line 
1#pragma once
2
3#include <osg/Referenced>
4#include <OpenThreads/Thread>
5
6
7class ChannelWorker : public osg::Referenced, public OpenThreads::Thread
8{
9public:
10        ChannelWorker() ;
11        ~ChannelWorker();       //Destroying the thread object will implicit call cancel(), then the function will block until the thread has finished.
12        virtual void run();
13        virtual int cancel();
14       
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; } 
17
18private:
19        bool _done;
20};
Note: See TracBrowser for help on using the repository browser.