SourcePro® 2024.1 |
SourcePro® API Reference Guide |
Efficient stand-in for a mutual exclusion lock when synchronization is either unnecessary or not important. More...
#include <rw/sync/RWNullMutexLock.h>
Public Types | |
typedef RWTLockGuard< RWNullMutexLock > | LockGuard |
typedef RWTReadLockGuard< RWNullMutexLock > | ReadLockGuard |
typedef RWTReadUnlockGuard< RWNullMutexLock > | ReadUnlockGuard |
typedef RWTTryLockGuard< RWNullMutexLock > | TryLockGuard |
typedef RWTTryReadLockGuard< RWNullMutexLock > | TryReadLockGuard |
typedef RWTTryWriteLockGuard< RWNullMutexLock > | TryWriteLockGuard |
typedef RWTUnlockGuard< RWNullMutexLock > | UnlockGuard |
typedef RWTWriteLockGuard< RWNullMutexLock > | WriteLockGuard |
typedef RWTWriteUnlockGuard< RWNullMutexLock > | WriteUnlockGuard |
Public Member Functions | |
RWNullMutexLock (RWCancellationState state=0) | |
RWNullMutexLock (RWStaticCtor) | |
~RWNullMutexLock () | |
void | acquire () |
RWWaitStatus | acquire (unsigned long milliseconds) |
void | acquireRead () |
RWWaitStatus | acquireRead (unsigned long milliseconds) |
void | acquireWrite () |
RWWaitStatus | acquireWrite (unsigned long milliseconds) |
bool | isAcquired () const |
void | release () |
bool | tryAcquire () |
bool | tryAcquireRead () |
bool | tryAcquireWrite () |
Public Member Functions inherited from RWSynchObject | |
void | disableCancellation () |
void | enableCancellation (RWCancellationState) |
bool | isCancellationEnabled () const |
void | setCancellation (RWCancellationState) |
Private Member Functions | |
RWNullMutexLock (const RWNullMutexLock &second) | |
RWNullMutexLock & | operator= (const RWNullMutexLock &second) |
Additional Inherited Members | |
Protected Member Functions inherited from RWSynchObject | |
RWSynchObject (const RWSynchObject &second) | |
RWSynchObject (RWCancellationState state=0) | |
RWSynchObject (RWStaticCtor) | |
RWSynchObject & | operator= (const RWSynchObject &second) |
void | testCancellation () |
Related Symbols inherited from RWSynchObject | |
#define | RW_CANCELLATION_DISABLED |
#define | RW_CANCELLATION_ENABLED |
typedef void(* | RWCancellationState) () |
void | rwServiceCancellation (void) |
An RWNullMutexLock is an efficient stand-in for a mutual exclusion lock, particularly when you know that critical sections of code do not need synchronization. For example, you may know that it is not possible for more than one thread to simultaneously enter a section of code that would otherwise require locking. In such cases, you can use an RWNullMutexLock to eliminate the unnecessary overhead of acquiring and releasing a mutex. This class can also be used to instantiate a single-threaded or non-thread-safe version of the template classes that accept a mutex parameter, such as RWTMonitor.
Predefined type for compatible guard.
Predefined type for compatible guard.
Predefined type for compatible guard.
Predefined type for compatible guard.
Predefined type for compatible guard.
Predefined type for compatible guard.
Predefined type for compatible guard.
Predefined type for compatible guard.
Predefined type for compatible guard.
|
inline |
Constructs a static instance, but does no direct initialization. The RWNullMutexLock 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 RWNullMutexLock with a cancellation state of RW_CANCELLATION_DISABLED.
|
inline |
Creates an RWNullMutexLock. The parameter state is currently ignored.
|
inline |
Destructor.
|
private |
Copy construction prohibited.
|
inline |
Does nothing.
|
inline |
Returns RW_THR_ACQUIRED.
|
inline |
Does nothing.
|
inline |
Returns RW_THR_ACQUIRED.
|
inline |
Does nothing.
|
inline |
Returns RW_THR_ACQUIRED.
bool RWNullMutexLock::isAcquired | ( | ) | const |
Returns true
.
|
private |
Assignment prohibited.
|
inline |
Does nothing.
|
inline |
Returns true
.
|
inline |
Returns true
.
|
inline |
Returns true
.
Copyright © 2024 Rogue Wave Software, Inc., a Perforce company. All Rights Reserved. |