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

Last change on this file since 422 was 422, checked in by Torben Dannhauer, 12 years ago
File size: 773 bytes
RevLine 
[420]1#pragma once
2
3#include <osg/Referenced>
4#include <OpenThreads/Thread>
5
[422]6/**
7 * \brief This class is a Thread Object which allows to create Functors and attach them to this thread object.
8 *
9 * @author Torben Dannhauer
10 * @date  Okt 2012
11 */ 
[420]12class ChannelWorker : public osg::Referenced, public OpenThreads::Thread
13{
14public:
[421]15        ChannelWorker() ;
16        ~ChannelWorker();       //Destroying the thread object will implicit call cancel(), then the function will block until the thread has finished.
[420]17        virtual void run();
18        virtual int cancel();
19       
[421]20        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.
21        bool getDone() const { return _done; } 
[420]22
23private:
24        bool _done;
25};
Note: See TracBrowser for help on using the repository browser.