SourcePro® 2022.1 |
SourcePro® API Reference Guide |
Base class for synchronization classes. More...
#include <rw/sync/RWSynchObject.h>
Public Member Functions | |
void | disableCancellation () |
void | enableCancellation (RWCancellationState) |
bool | isCancellationEnabled () const |
void | setCancellation (RWCancellationState) |
Protected Member Functions | |
RWSynchObject (RWCancellationState state=0) | |
RWSynchObject (RWStaticCtor) | |
RWSynchObject (const RWSynchObject &second) | |
RWSynchObject & | operator= (const RWSynchObject &second) |
void | testCancellation () |
Related Functions | |
(Note that these are not member functions.) | |
#define | RW_CANCELLATION_DISABLED |
#define | RW_CANCELLATION_ENABLED |
typedef void(* | RWCancellationState) () |
void | rwServiceCancellation (void) |
RWSynchObject is the base class for synchronization classes, RWMutexLock, RWFIFOMutexLock, RWTRecursiveLock, RWSemaphore, RWCondition, RWReadersWriterLock, and RWCriticalSection. The class contains methods that support automatic cancellation detection for runnables containing a thread that is accessing the acquire() or wait() members of these derived classes.
|
inlineprotected |
Enforces that this class be used only as a base class.
|
inlineprotected |
Constructs a static instance, but does no direct initialization. The RWSynchObject is initialized on first use.
This constructor must be used only for static instances. Use of this constructor with an automatically or dynamically allocated instance produces errors or other unpredictable behavior.
Static instances are zero initialized, which results in an RWSynchObject with a cancellation state of RW_CANCELLATION_DISABLED.
|
inlineprotected |
Copy constructor.
|
inline |
Turns off automatic cancellation detection.
|
inline |
Turns on automatic cancellation detection.
|
inline |
Returns true
if automatic cancellation is enabled, otherwise false
.
|
inlineprotected |
Assignment operator.
|
inline |
Turns on automatic cancellation detection.
|
inlineprotected |
Invokes a cancellation method if one has been registered, otherwise does nothing.
|
related |
Flag to specify cancellation state.
|
related |
Flag to specify cancellation state, defined in the Threading package as &rwServiceCancellation.
|
related |
This function pointer type is used with the Synchronization objects to set the cancellation policy.
RW_CANCELLATION_DISABLED is defined in the Synchronization package to be 0. RW_CANCELLATION_ENABLED is defined in the Threading package as &rwServiceCancellation. Either macro may be passed where an RWCancellationState is expected. For example, see RWSynchObject::setCancellation(RWCancellationState).
For information on changes in RWCancellationState and compatibility with previous versions of Threads.h++, please see the Threads Module User's Guide.
|
related |
This function determines the calling thread's current runnable, if any, and calls RWRunnableSelf::serviceCancellation() on that runnable. If cancellation has been requested on the runnable object, then an RWCancellation exception is thrown.
Note that this function looks up the current runnable every time it is called. If you need to service cancellation repeatedly, e.g., within a loop, it is more efficient to call the global function rwRunnable() to get an RWRunnableSelf handle for the current runnable, and then call RWRunnableSelf::serviceCancellation() directly on this handle instance each time.
Copyright © 2022 Rogue Wave Software, Inc., a Perforce company. All Rights Reserved. |