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

#include <mutex.hpp>

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

Public Types

using native_handle_type = void *
 

Public Member Functions

 Mutex ()=default
 
 ~Mutex () noexcept=default
 
 Mutex (const Mutex &)=delete
 
Mutexoperator= (const Mutex &)=delete
 
void lock ()
 
bool try_lock () noexcept
 
void unlock () noexcept
 
native_handle_type native_handle ()
 

Protected Attributes

FiberQueue _queue
 
bool _occupied {false}
 

Detailed Description

Definition at line 9 of file mutex.hpp.

Member Typedef Documentation

◆ native_handle_type

Constructor & Destructor Documentation

◆ Mutex() [1/2]

yaclib::detail::fiber::Mutex::Mutex ( )
default

◆ ~Mutex()

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

◆ Mutex() [2/2]

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

Member Function Documentation

◆ lock()

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

Definition at line 5 of file mutex.cpp.

References _occupied, _queue, and yaclib::detail::fiber::FiberQueue::Wait().

◆ native_handle()

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

Definition at line 25 of file mutex.cpp.

◆ operator=()

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

◆ try_lock()

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

Definition at line 12 of file mutex.cpp.

References _occupied.

◆ unlock()

void yaclib::detail::fiber::Mutex::unlock ( )
noexcept

Definition at line 20 of file mutex.cpp.

References _occupied, _queue, and yaclib::detail::fiber::FiberQueue::NotifyOne().

Member Data Documentation

◆ _occupied

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

Definition at line 27 of file mutex.hpp.

Referenced by lock(), try_lock(), and unlock().

◆ _queue

FiberQueue yaclib::detail::fiber::Mutex::_queue
protected

Definition at line 26 of file mutex.hpp.

Referenced by lock(), and unlock().


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