OW_NAMESPACE::Runnable Class Reference

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

#include <OW_Runnable.hpp>

Inheritance diagram for OW_NAMESPACE::Runnable:

Inheritance graph
[legend]
Collaboration diagram for OW_NAMESPACE::Runnable:

Collaboration graph
[legend]
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 54 of file OW_Runnable.hpp.


Constructor & Destructor Documentation

OW_NAMESPACE::Runnable::~Runnable  )  [virtual]
 

Definition at line 44 of file OW_Runnable.cpp.


Member Function Documentation

void OW_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 

Reimplemented in OW_NAMESPACE::PollingManagerThread::TriggerRunner, and OW_NAMESPACE::HTTPSvrConnection.

Definition at line 50 of file OW_Runnable.cpp.

void OW_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 

Reimplemented in OW_NAMESPACE::PollingManagerThread::TriggerRunner.

Definition at line 56 of file OW_Runnable.cpp.

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

Implemented in OW_NAMESPACE::PollingManagerThread::TriggerRunner, and OW_NAMESPACE::HTTPSvrConnection.


The documentation for this class was generated from the following files:
Generated on Thu Feb 9 09:14:20 2006 for openwbem by  doxygen 1.4.6