ADTF
Loading...
Searching...
No Matches
a_util::concurrency::shared_mutex Class Reference

#include <shared_mutex.h>

Public Member Functions

 shared_mutex ()
 CTOR - creates the mutex in an unlocked state.
 
 ~shared_mutex ()
 DTOR - does not call unlock!
 
void lock ()
 Lock the mutex, blocks if the mutex is not available.
 
bool try_lock ()
 
void unlock ()
 Unlock the mutex.
 
void lock_shared ()
 Lock the mutex for shared ownership, blocks if the mutex is not available.
 
bool try_lock_shared ()
 
void unlock_shared ()
 Unlock the mutex (shared ownership)
 

Detailed Description

A shared_mutex class as a workaround for std::shared_timed_mutex

See also
https://stackoverflow.com/a/42302130

Member Function Documentation

◆ try_lock()

bool a_util::concurrency::shared_mutex::try_lock ( )

Try to lock the mutex.

Returns
true if successfully locked, false otherwise.

◆ try_lock_shared()

bool a_util::concurrency::shared_mutex::try_lock_shared ( )

Try to lock the mutex for shared ownership

Returns
true if successfully locked, false otherwise

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