libUTL++
utl::RWlockLFguard Class Reference

Acquire/release a RWlockLF RAII-style. More...

#include <RWlockLF.h>

Public Member Functions

 RWlockLFguard ()
 Default constructor. More...
 
 RWlockLFguard (RWlockLF *rwlock, uint_t mode)
 Constructor. More...
 
 ~RWlockLFguard ()
 Destructor. More...
 
void lock (RWlockLF *rwlock, uint_t mode)
 Acquire read- or write-lock. More...
 
void lock (uint_t mode)
 Acquire read- or write-lock. More...
 
void rdlock (RWlockLF *rwlock)
 Acquire read-lock. More...
 
void wrlock (RWlockLF *rwlock)
 Acquire write-lock. More...
 
void rdlock ()
 Acquire read-lock. More...
 
void wrlock ()
 Acquire write-lock. More...
 
bool trylock (RWlockLF *rwlock, uint_t mode)
 Try to acquire read- or write-lock (without blocking). More...
 
bool trylock (uint_t mode)
 Try to acquire read- or write-lock (without blocking). More...
 
bool tryrdlock (RWlockLF *rwlock)
 Try to acquire read-lock (without blocking). More...
 
bool trywrlock (RWlockLF *rwlock)
 Try to acquire write-lock (without blocking). More...
 
bool tryrdlock ()
 Try to acquire read-lock (without blocking). More...
 
bool trywrlock ()
 Try to acquire write-lock (without blocking). More...
 
void unlock ()
 Release the lock. More...
 

Detailed Description

Acquire/release a RWlockLF RAII-style.

Author
Adam McKee

Definition at line 121 of file RWlockLF.h.

Constructor & Destructor Documentation

◆ RWlockLFguard() [1/2]

utl::RWlockLFguard::RWlockLFguard ( )
inline

Default constructor.

Definition at line 125 of file RWlockLF.h.

◆ RWlockLFguard() [2/2]

utl::RWlockLFguard::RWlockLFguard ( RWlockLF rwlock,
uint_t  mode 
)
inline

Constructor.

Parameters
rwlockRWlockLF to lock
mode(io_rd : read-lock, io_wr : write-lock)

Definition at line 136 of file RWlockLF.h.

◆ ~RWlockLFguard()

utl::RWlockLFguard::~RWlockLFguard ( )
inline

Destructor.

Definition at line 144 of file RWlockLF.h.

Member Function Documentation

◆ lock() [1/2]

void utl::RWlockLFguard::lock ( RWlockLF rwlock,
uint_t  mode 
)
inline

Acquire read- or write-lock.

Parameters
rwlockRWlockLF to lock
mode(io_rd : read-lock, io_wr : write-lock)

Definition at line 155 of file RWlockLF.h.

◆ lock() [2/2]

void utl::RWlockLFguard::lock ( uint_t  mode)
inline

Acquire read- or write-lock.

Parameters
mode(io_rd : read-lock, io_wr : write-lock)

Definition at line 167 of file RWlockLF.h.

References utl::io_rd.

◆ rdlock() [1/2]

void utl::RWlockLFguard::rdlock ( RWlockLF rwlock)
inline

Acquire read-lock.

Parameters
rwlockRWlockLF to lock

Definition at line 177 of file RWlockLF.h.

◆ wrlock() [1/2]

void utl::RWlockLFguard::wrlock ( RWlockLF rwlock)
inline

Acquire write-lock.

Parameters
rwlockRWlockLF to lock

Definition at line 189 of file RWlockLF.h.

◆ rdlock() [2/2]

void utl::RWlockLFguard::rdlock ( )
inline

Acquire read-lock.

Definition at line 198 of file RWlockLF.h.

◆ wrlock() [2/2]

void utl::RWlockLFguard::wrlock ( )
inline

Acquire write-lock.

Definition at line 206 of file RWlockLF.h.

◆ trylock() [1/2]

bool utl::RWlockLFguard::trylock ( RWlockLF rwlock,
uint_t  mode 
)
inline

Try to acquire read- or write-lock (without blocking).

Parameters
rwlockRWlockLF to lock
mode(io_rd : read-lock, io_wr : write-lock)
Returns
true if lock acquired, false otherwise

Definition at line 219 of file RWlockLF.h.

◆ trylock() [2/2]

bool utl::RWlockLFguard::trylock ( uint_t  mode)
inline

Try to acquire read- or write-lock (without blocking).

Parameters
mode(io_rd : read-lock, io_wr : write-lock)
Returns
true if lock acquired, false otherwise

Definition at line 232 of file RWlockLF.h.

References utl::io_rd.

◆ tryrdlock() [1/2]

bool utl::RWlockLFguard::tryrdlock ( RWlockLF rwlock)
inline

Try to acquire read-lock (without blocking).

Parameters
rwlockRWlockLF to lock
Returns
true if read-lock acquired, false otherwise

Definition at line 243 of file RWlockLF.h.

◆ trywrlock() [1/2]

bool utl::RWlockLFguard::trywrlock ( RWlockLF rwlock)
inline

Try to acquire write-lock (without blocking).

Parameters
rwlockRWlockLF to lock
Returns
true if write-lock acquired, false otherwise

Definition at line 256 of file RWlockLF.h.

◆ tryrdlock() [2/2]

bool utl::RWlockLFguard::tryrdlock ( )
inline

Try to acquire read-lock (without blocking).

Returns
true if read-lock acquired, false otherwise

Definition at line 268 of file RWlockLF.h.

◆ trywrlock() [2/2]

bool utl::RWlockLFguard::trywrlock ( )
inline

Try to acquire write-lock (without blocking).

Returns
true if write-lock acquired, false otherwise

Definition at line 279 of file RWlockLF.h.

◆ unlock()

void utl::RWlockLFguard::unlock ( )
inline

Release the lock.

Definition at line 287 of file RWlockLF.h.

References ASSERTD, and utl::io_rd.


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