Represents an exception that is thrown to cancel a thread. More...
#include <rw/thread/RWCancellation.h>
Public Member Functions | |
RWCancellation (RWRunnableImp *runnableImpP) | |
RWCancellation (const RWCancellation &second) | |
virtual RWTHRxmsg * | clone (void) const |
virtual void | raise (void) const |
Public Member Functions inherited from RWTHRxmsg | |
RWTHRxmsg (void) | |
RWTHRxmsg (const RWCString &msg) | |
RWTHRxmsg (const RWTHRxmsg &second) | |
virtual | ~RWTHRxmsg (void) |
RWTHRxmsg & | operator= (const RWTHRxmsg &second) |
Public Member Functions inherited from RWxmsg | |
RWxmsg (const char *msg) | |
RWxmsg (const RWxmsg &msg) | |
RWxmsg (RWxmsg &&msg) | |
RWxmsg & | operator= (const RWxmsg &) |
RWxmsg & | operator= (RWxmsg &&msg) |
void | swap (RWxmsg &rhs) |
virtual const char * | why () const |
Public Member Functions inherited from RWHandleBase | |
bool | isValid (void) const |
bool | operator!= (const RWHandleBase &second) const |
bool | operator< (const RWHandleBase &second) const |
bool | operator== (const RWHandleBase &second) const |
Additional Inherited Members | |
Protected Member Functions inherited from RWxmsg | |
RWxmsg (const char *msg, bool doCopy) | |
Protected Member Functions inherited from RWHandleBase | |
RWHandleBase (void) | |
RWHandleBase (RWStaticCtor) | |
RWHandleBase (RWBodyBase *body) | |
RWHandleBase (const RWHandleBase &second) | |
~RWHandleBase (void) | |
RWBodyBase & | body (void) const |
RWHandleBase & | operator= (const RWHandleBase &second) |
Related Functions inherited from RWxmsg | |
#define | RWTHROW(a) |
RWCancellation is an exception that is thrown to cancel a thread. It may be caught by the thread in order to clean up resources or perform final shutdown operations. Thread cancellation allows an application to stop a thread at a safe point in its execution. Thread cancellation is especially useful for stopping threads that are executing in infinite loops.
A thread is canceled when an external thread calls requestCancellation() on the RWRunnable object. The thread cancellation starts when RWRunnableSelf::serviceCancellation() is called from within the canceled thread. If cancellation has been requested on that thread via RWRunnable::requestCancellation(), then an RWCancellation exception is thrown out of RWRunnableSelf::serviceCancellation().
RWRunnableSelf::serviceCancellation() is also called implicitly from within the acquire() or wait() methods of a synchronization object, when that synchronization object has been initialized with RW_CANCELLATION_ENABLED. The global function called rwServiceCancellation() may also be used as a substitute for RWRunnableSelf::serviceCancellation() member function.
RWCancellation::RWCancellation | ( | RWRunnableImp * | runnableImpP | ) |
Constructs a cancellation instance that is targeted at the specified runnable.
|
inline |
Copy constructor. Required for exception propagation.
|
virtual |
Calls the copy constructor of the runtime (derived) type of self and returns the result.
Reimplemented from RWTHRxmsg.
|
virtual |
Throws an exception of the runtime (derived) type of self.
Reimplemented from RWTHRxmsg.
Copyright © 2021 Rogue Wave Software, Inc., a Perforce company. All Rights Reserved. |