BLOCXX_NAMESPACE::Runnable Class Reference

There are two methods for creating a thread of execution in the OW systems. More...

#include <Runnable.hpp>

Inheritance diagram for BLOCXX_NAMESPACE::Runnable:

BLOCXX_NAMESPACE::IntrusiveCountableBase List of all members.

Public Member Functions

virtual ~Runnable ()
virtual void run ()=0
virtual void doCooperativeCancel ()
 This function is available for subclasses to override if they wish to be notified when a cooperative cancel is being invoked on the thread.
virtual void doDefinitiveCancel ()
 See the documentation for doCooperativeCancel().

Detailed Description

There are two methods for creating a thread of execution in the OW systems.

One is to derive from Thread and implement the run method and call start on instances of the class to get the thread running. The other method is to derive from Runnable and pass references of the derived class to ThreadPool::addWork()

Definition at line 56 of file Runnable.hpp.


Constructor & Destructor Documentation

BLOCXX_NAMESPACE::Runnable::~Runnable  )  [virtual]
 

Definition at line 46 of file Runnable.cpp.


Member Function Documentation

void BLOCXX_NAMESPACE::Runnable::doCooperativeCancel  )  [virtual]
 

This function is available for subclasses to override if they wish to be notified when a cooperative cancel is being invoked on the thread.

Note that this function will be invoked in a separate thread. For instance, a thread may use this function to write to a pipe or socket, if Thread::run() is blocked in select(), it can be unblocked and instructed to exit.

It is also possible for an individual thread to override the cancellation request, if it knows that cancellation at this time may crash the system or cause a deadlock. To do this, the thread should throw an CancellationDeniedException. Note that threads are usually only cancelled in the event of a system shutdown or restart, so a thread should make a best effort to actually shutdown.

Exceptions:
CancellationDeniedException 

Definition at line 52 of file Runnable.cpp.

void BLOCXX_NAMESPACE::Runnable::doDefinitiveCancel  )  [virtual]
 

See the documentation for doCooperativeCancel().

When definitiveCancel() is called on a thread, first doCooperativeCancel() will be called, and then doDefinitiveCancel() will be called.

Exceptions:
CancellationDeniedException 

Definition at line 58 of file Runnable.cpp.

virtual void BLOCXX_NAMESPACE::Runnable::run  )  [pure virtual]
 


The documentation for this class was generated from the following files:
Generated on Fri Jun 16 15:39:11 2006 for blocxx by  doxygen 1.4.6