NDEVR
API Documentation
MultiWLock

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

Public Member Functions

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

Detailed Description

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


Automatically unlocks all held locks on destruction.

Definition at line 337 of file RWLock.h.

Constructor & Destructor Documentation

◆ MultiWLock() [1/4]

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

Constructs write locks on multiple entries identified by pointers.

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

Referenced by MultiWLock().

◆ MultiWLock() [2/4]

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

Constructs write 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.

◆ MultiWLock() [3/4]

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

Constructs write locks on multiple RWLocks directly.

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

◆ MultiWLock() [4/4]

MultiWLock::MultiWLock ( MultiWLock && lock)
noexcept

Move constructor.

Transfers lock ownership from another MultiWLock.

Parameters
[in]lockThe MultiWLock to move from.

References MultiWLock().

◆ ~MultiWLock()

MultiWLock::~MultiWLock ( )

Destructor.

Releases all held write locks.

Member Function Documentation

◆ isLocked()

bool MultiWLock::isLocked ( ) const

Returns whether all locks in this MultiWLock are currently held.

Returns
True if all locks are held.

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