nidas v1.2.3
|
#include <Thread.h>
Public Member Functions | |
virtual | ~Runnable () |
virtual int | run ()=0 |
The method which will run in its own thread. | |
virtual void | interrupt ()=0 |
Interrupt this run method. | |
virtual bool | isInterrupted () const =0 |
Has the run method been interrupted? | |
Protected Member Functions | |
void | testCancel () const |
Check if we have been cancelled. | |
virtual bool | amInterrupted () const |
Call testCancel, and return true when this thread has been interrupted. | |
|
inlinevirtual |
|
protectedvirtual |
Call testCancel, and return true when this thread has been interrupted.
This is protected because it should only called within the run method of the thread.
References isInterrupted(), and testCancel().
Referenced by nidas::core::Looper::run(), nidas::core::SampleOutputRequestThread::run(), and nidas::core::DSMServerStat::run().
|
pure virtual |
Interrupt this run method.
This sets a flag which can be tested with isInterrupted(). It is up to the run() implementation to return when interrupted.
Implemented in nidas::core::DerivedDataReader, nidas::core::SampleBuffer, nidas::core::SampleOutputRequestThread, nidas::core::SampleSorter, nidas::core::SensorHandler, nidas::core::SensorOpener, nidas::core::Socket::ConnectionThread, nidas::core::ServerSocket::ConnectionThread, nidas::core::XmlRpcThread, nidas::dynld::raf::SyncServer, nidas::dynld::RawSampleService::Worker, nidas::dynld::UDPSampleOutput::VariableListWorker, nidas::dynld::UDPSampleOutput::XMLSocketListener, nidas::dynld::XMLConfigService::Worker, nidas::util::McSocketListener, nidas::util::McSocketMulticaster< SocketTT >, nidas::util::Thread, and nidas::util::ThreadRunnable.
Referenced by nidas::util::ThreadRunnable::interrupt().
|
pure virtual |
Has the run method been interrupted?
Implemented in nidas::util::Thread.
Referenced by amInterrupted().
|
pure virtual |
The method which will run in its own thread.
This method must be supplied by the Runnable or Thread subclass.
Exception |
Implemented in WriterThread, ServerThread, DataWriter, PSI, TestSource, Sender, ModemLineSetter, ModemLineMonitor, nidas::core::DerivedDataReader, nidas::core::DSMEngineIntf, nidas::core::DSMServerIntf, nidas::core::FsMountWorkerThread, nidas::core::Looper, nidas::core::SampleBuffer, nidas::core::SampleOutputRequestThread, nidas::core::SampleSorter, nidas::core::SensorHandler, nidas::core::SensorOpener, nidas::core::Socket::ConnectionThread, nidas::core::ServerSocket::ConnectionThread, nidas::core::StatusListener, nidas::core::DSMEngineStat, nidas::core::DSMServerStat, nidas::dynld::raf::SyncServer, nidas::dynld::RawSampleService::Worker, nidas::dynld::UDPSampleOutput::VariableListWorker, nidas::dynld::UDPSampleOutput::ConnectionMonitor, nidas::dynld::UDPSampleOutput::XMLSocketListener, nidas::dynld::XMLConfigService::Worker, nidas::util::McSocketListener, nidas::util::McSocketMulticaster< SocketTT >, nidas::util::ThreadRunnable, and nidas::util::ThreadJoiner.
Referenced by nidas::util::Thread::pRun(), nidas::util::ThreadRunnable::run(), and nidas::util::Thread::start().
|
inlineprotected |
Check if we have been cancelled.
Calls pthread_testcancel. This is protected since it only checks the current thread - i.e. it must be called within the run method. Since it just calls pthread_testcancel, it is a cancellation point.
Referenced by amInterrupted(), and TestSource::run().