YACLib
C++ library for concurrent tasks execution
|
#include <shared_mutex.hpp>
Public Types | |
using | native_handle_type = void * |
Public Member Functions | |
SharedMutex ()=default | |
~SharedMutex () noexcept=default | |
SharedMutex (const SharedMutex &)=delete | |
SharedMutex & | operator= (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} |
Definition at line 7 of file shared_mutex.hpp.
Definition at line 25 of file shared_mutex.hpp.
|
default |
|
defaultnoexcept |
|
delete |
void yaclib::detail::fiber::SharedMutex::lock | ( | ) |
Definition at line 7 of file shared_mutex.cpp.
void yaclib::detail::fiber::SharedMutex::lock_shared | ( | ) |
Definition at line 32 of file shared_mutex.cpp.
References _exclusive_mode, _exclusive_queue, _occupied, SharedLockHelper(), and yaclib::detail::fiber::FiberQueue::Wait().
|
protected |
Definition at line 55 of file shared_mutex.cpp.
References _exclusive_mode, and _occupied.
Referenced by try_lock().
|
inline |
Definition at line 66 of file shared_mutex.cpp.
|
delete |
|
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().
|
noexcept |
Definition at line 14 of file shared_mutex.cpp.
References _occupied, and LockHelper().
bool yaclib::detail::fiber::SharedMutex::try_lock_shared | ( | ) |
Definition at line 39 of file shared_mutex.cpp.
References _exclusive_mode, _occupied, and SharedLockHelper().
|
noexcept |
Definition at line 22 of file shared_mutex.cpp.
References _exclusive_queue, _occupied, _shared_queue, yaclib::detail::fiber::FiberQueue::Empty(), yaclib::detail::GetRandNumber(), yaclib::detail::fiber::FiberQueue::NotifyAll(), yaclib::detail::fiber::FiberQueue::NotifyOne(), and unlock_shared().
void yaclib::detail::fiber::SharedMutex::unlock_shared | ( | ) |
Definition at line 47 of file shared_mutex.cpp.
References _exclusive_queue, _occupied, _shared_owners_count, and yaclib::detail::fiber::FiberQueue::NotifyOne().
Referenced by unlock().
Definition at line 37 of file shared_mutex.hpp.
Referenced by lock_shared(), LockHelper(), SharedLockHelper(), and try_lock_shared().
|
protected |
Definition at line 34 of file shared_mutex.hpp.
Referenced by lock_shared(), unlock(), and unlock_shared().
Definition at line 36 of file shared_mutex.hpp.
Referenced by lock_shared(), LockHelper(), SharedLockHelper(), try_lock(), try_lock_shared(), unlock(), and unlock_shared().
|
protected |
Definition at line 35 of file shared_mutex.hpp.
Referenced by SharedLockHelper(), and unlock_shared().
|
protected |
Definition at line 33 of file shared_mutex.hpp.
Referenced by unlock().