CommRaT 2.0.0
C++20 Real-Time Messaging Framework
Loading...
Searching...
No Matches
commrat::SharedMutex Class Reference

Shared mutex wrapper (reader-writer lock) More...

#include <commrat/platform/threading.hpp>

Public Member Functions

 SharedMutex ()=default
 
 ~SharedMutex ()=default
 
 SharedMutex (const SharedMutex &)=delete
 
SharedMutexoperator= (const SharedMutex &)=delete
 
void lock ()
 
void lock_shared ()
 
bool try_lock ()
 
bool try_lock_shared ()
 
void unlock ()
 
void unlock_shared ()
 
std::shared_mutex & native ()
 

Detailed Description

Shared mutex wrapper (reader-writer lock)

Multiple readers OR single writer. Useful for ring buffers where reads are frequent, writes are rare.

Definition at line 270 of file threading.hpp.

Constructor & Destructor Documentation

◆ SharedMutex() [1/2]

commrat::SharedMutex::SharedMutex ( )
default

◆ ~SharedMutex()

commrat::SharedMutex::~SharedMutex ( )
default

◆ SharedMutex() [2/2]

commrat::SharedMutex::SharedMutex ( const SharedMutex )
delete

Member Function Documentation

◆ lock()

void commrat::SharedMutex::lock ( )
inline

Definition at line 279 of file threading.hpp.

◆ lock_shared()

void commrat::SharedMutex::lock_shared ( )
inline

Definition at line 280 of file threading.hpp.

◆ native()

std::shared_mutex & commrat::SharedMutex::native ( )
inline

Definition at line 286 of file threading.hpp.

◆ operator=()

SharedMutex & commrat::SharedMutex::operator= ( const SharedMutex )
delete

◆ try_lock()

bool commrat::SharedMutex::try_lock ( )
inline

Definition at line 281 of file threading.hpp.

◆ try_lock_shared()

bool commrat::SharedMutex::try_lock_shared ( )
inline

Definition at line 282 of file threading.hpp.

◆ unlock()

void commrat::SharedMutex::unlock ( )
inline

Definition at line 283 of file threading.hpp.

◆ unlock_shared()

void commrat::SharedMutex::unlock_shared ( )
inline

Definition at line 284 of file threading.hpp.


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