NDEVR
API Documentation
MultiRLock

Acquires read locks on multiple RWLocks simultaneously in a deadlock-safe order. More...

Public Member Functions

 MultiRLock (MultiRLock &&lock) noexcept
 Move constructor.
 MultiRLock (std::initializer_list< const void * > l)
 Constructs read locks on multiple entries identified by pointers.
 MultiRLock (std::initializer_list< const void * > l, uint08 timeout)
 Constructs read locks on multiple entries with a timeout.
 MultiRLock (std::initializer_list< RWLock * > l)
 Constructs read locks on multiple RWLocks directly.
 ~MultiRLock ()
 Destructor.
bool isLocked () const
 Returns whether all locks in this MultiRLock are currently held.

Detailed Description

Acquires read locks on multiple RWLocks simultaneously in a deadlock-safe order.


Automatically unlocks all held locks on destruction.

Definition at line 222 of file RWLock.h.

Constructor & Destructor Documentation

◆ MultiRLock() [1/4]

MultiRLock::MultiRLock ( std::initializer_list< const void * > l)

Constructs read locks on multiple entries identified by pointers.

Parameters
[in]lThe list of pointer keys used to look up the RWLocks.

Referenced by MultiRLock().

◆ MultiRLock() [2/4]

MultiRLock::MultiRLock ( std::initializer_list< RWLock * > l)

Constructs read locks on multiple RWLocks directly.

Parameters
[in]lThe list of RWLock pointers to acquire read locks on.

◆ MultiRLock() [3/4]

MultiRLock::MultiRLock ( std::initializer_list< const void * > l,
uint08 timeout )

Constructs read locks on multiple entries with a timeout.

Parameters
[in]lThe list of pointer keys used to look up the RWLocks.
[in]timeoutThe maximum time in nanoseconds to wait for each lock.

◆ MultiRLock() [4/4]

MultiRLock::MultiRLock ( MultiRLock && lock)
noexcept

Move constructor.

Transfers lock ownership from another MultiRLock.

Parameters
[in]lockThe MultiRLock to move from.

References MultiRLock().

◆ ~MultiRLock()

MultiRLock::~MultiRLock ( )

Destructor.

Releases all held read locks.

Member Function Documentation

◆ isLocked()

bool MultiRLock::isLocked ( ) const

Returns whether all locks in this MultiRLock are currently held.

Returns
True if all locks are held.

The documentation for this class was generated from the following file: