SourcePro® 2025.1 |
SourcePro® API Reference Guide |
Represents an exception that is thrown to cancel a thread. More...
#include <rw/thread/RWCancellation.h>
Public Member Functions | |
| RWCancellation (const RWCancellation &second) | |
| RWCancellation (RWRunnableImp *runnableImpP) | |
| virtual RWTHRxmsg * | clone (void) const |
| virtual void | raise (void) const |
Public Member Functions inherited from RWTHRxmsg | |
| RWTHRxmsg (const RWCString &msg) | |
| RWTHRxmsg (const RWTHRxmsg &second) | |
| RWTHRxmsg (void) | |
| 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 |
Additional Inherited Members | |
Protected Member Functions inherited from RWxmsg | |
| RWxmsg (const char *msg, bool doCopy) | |
Protected Member Functions inherited from RWHandleBase | |
| RWHandleBase (const RWHandleBase &second) | |
| RWHandleBase (RWBodyBase *body) | |
| RWHandleBase (RWStaticCtor) | |
| RWHandleBase (void) | |
| ~RWHandleBase (void) | |
| RWBodyBase & | body (void) const |
| RWHandleBase & | operator= (const RWHandleBase &second) |
Related Symbols inherited from RWxmsg | |
| #define | RWTHROW(a) |
Related Symbols inherited from RWHandleBase | |
| bool | operator!= (const RWHandleBase &lhs, const RWHandleBase &rhs) |
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.
|
explicit |
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 © 2025 Rogue Wave Software, Inc., a Perforce company. All Rights Reserved. |