#include <OW_Runnable.hpp>
Inheritance diagram for OW_NAMESPACE::Runnable:
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(). |
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.
|
Definition at line 44 of file OW_Runnable.cpp. |
|
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.
Reimplemented in OW_NAMESPACE::PollingManagerThread::TriggerRunner, and OW_NAMESPACE::HTTPSvrConnection. Definition at line 50 of file OW_Runnable.cpp. |
|
See the documentation for doCooperativeCancel(). When definitiveCancel() is called on a thread, first doCooperativeCancel() will be called, and then doDefinitiveCancel() will be called.
Reimplemented in OW_NAMESPACE::PollingManagerThread::TriggerRunner. Definition at line 56 of file OW_Runnable.cpp. |
|
Implemented in OW_NAMESPACE::PollingManagerThread::TriggerRunner, and OW_NAMESPACE::HTTPSvrConnection. |