nidas v1.2.3
Public Member Functions | Protected Member Functions | List of all members
nidas::util::Runnable Class Referenceabstract

#include <Thread.h>

Inheritance diagram for nidas::util::Runnable:
Inheritance graph
[legend]

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.
 

Constructor & Destructor Documentation

◆ ~Runnable()

virtual nidas::util::Runnable::~Runnable ( )
inlinevirtual

Member Function Documentation

◆ amInterrupted()

bool Runnable::amInterrupted ( ) const
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().

◆ interrupt()

virtual void nidas::util::Runnable::interrupt ( )
pure virtual

◆ isInterrupted()

virtual bool nidas::util::Runnable::isInterrupted ( ) const
pure virtual

Has the run method been interrupted?

Implemented in nidas::util::Thread.

Referenced by amInterrupted().

◆ run()

virtual int nidas::util::Runnable::run ( )
pure virtual

◆ testCancel()

void nidas::util::Runnable::testCancel ( ) const
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().


The documentation for this class was generated from the following files: