YACLib
C++ library for concurrent tasks execution
Loading...
Searching...
No Matches
yaclib::detail::fiber::SharedMutex Class Reference

#include <shared_mutex.hpp>

Inheritance diagram for yaclib::detail::fiber::SharedMutex:
[legend]
Collaboration diagram for yaclib::detail::fiber::SharedMutex:
[legend]

Public Types

using native_handle_type = void *
 

Public Member Functions

 SharedMutex ()=default
 
 ~SharedMutex () noexcept=default
 
 SharedMutex (const SharedMutex &)=delete
 
SharedMutexoperator= (const SharedMutex &)=delete
 
void lock ()
 
bool try_lock () noexcept
 
void unlock () noexcept
 
void lock_shared ()
 
bool try_lock_shared ()
 
void unlock_shared ()
 
native_handle_type native_handle ()
 

Protected Member Functions

void LockHelper ()
 
void SharedLockHelper ()
 

Protected Attributes

FiberQueue _shared_queue
 
FiberQueue _exclusive_queue
 
std::uint32_t _shared_owners_count {0}
 
bool _occupied {false}
 
bool _exclusive_mode {false}
 

Detailed Description

Definition at line 7 of file shared_mutex.hpp.

Member Typedef Documentation

◆ native_handle_type

Constructor & Destructor Documentation

◆ SharedMutex() [1/2]

yaclib::detail::fiber::SharedMutex::SharedMutex ( )
default

◆ ~SharedMutex()

yaclib::detail::fiber::SharedMutex::~SharedMutex ( )
defaultnoexcept

◆ SharedMutex() [2/2]

yaclib::detail::fiber::SharedMutex::SharedMutex ( const SharedMutex )
delete

Member Function Documentation

◆ lock()

void yaclib::detail::fiber::SharedMutex::lock ( )

Definition at line 7 of file shared_mutex.cpp.

◆ lock_shared()

void yaclib::detail::fiber::SharedMutex::lock_shared ( )

◆ LockHelper()

void yaclib::detail::fiber::SharedMutex::LockHelper ( )
protected

Definition at line 55 of file shared_mutex.cpp.

References _exclusive_mode, and _occupied.

Referenced by try_lock().

◆ native_handle()

SharedMutex::native_handle_type yaclib::detail::fiber::SharedMutex::native_handle ( )
inline

Definition at line 66 of file shared_mutex.cpp.

◆ operator=()

SharedMutex & yaclib::detail::fiber::SharedMutex::operator= ( const SharedMutex )
delete

◆ SharedLockHelper()

void yaclib::detail::fiber::SharedMutex::SharedLockHelper ( )
protected

Definition at line 60 of file shared_mutex.cpp.

References _exclusive_mode, _occupied, and _shared_owners_count.

Referenced by lock_shared(), and try_lock_shared().

◆ try_lock()

bool yaclib::detail::fiber::SharedMutex::try_lock ( )
noexcept

Definition at line 14 of file shared_mutex.cpp.

References _occupied, and LockHelper().

◆ try_lock_shared()

bool yaclib::detail::fiber::SharedMutex::try_lock_shared ( )

Definition at line 39 of file shared_mutex.cpp.

References _exclusive_mode, _occupied, and SharedLockHelper().

◆ unlock()

◆ unlock_shared()

void yaclib::detail::fiber::SharedMutex::unlock_shared ( )

Member Data Documentation

◆ _exclusive_mode

bool yaclib::detail::fiber::SharedMutex::_exclusive_mode {false}
protected

Definition at line 37 of file shared_mutex.hpp.

Referenced by lock_shared(), LockHelper(), SharedLockHelper(), and try_lock_shared().

◆ _exclusive_queue

FiberQueue yaclib::detail::fiber::SharedMutex::_exclusive_queue
protected

Definition at line 34 of file shared_mutex.hpp.

Referenced by lock_shared(), unlock(), and unlock_shared().

◆ _occupied

bool yaclib::detail::fiber::SharedMutex::_occupied {false}
protected

◆ _shared_owners_count

std::uint32_t yaclib::detail::fiber::SharedMutex::_shared_owners_count {0}
protected

Definition at line 35 of file shared_mutex.hpp.

Referenced by SharedLockHelper(), and unlock_shared().

◆ _shared_queue

FiberQueue yaclib::detail::fiber::SharedMutex::_shared_queue
protected

Definition at line 33 of file shared_mutex.hpp.

Referenced by unlock().


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