join 1.0
lightweight network framework library
Loading...
Searching...
No Matches
join::RecursiveMutex Class Reference

class used to protect shared data from being simultaneously accessed by multiple threads. More...

#include <mutex.hpp>

Public Member Functions

 RecursiveMutex ()
 default constructor.
 
 RecursiveMutex (const Mutex &other)=delete
 copy constructor.
 
RecursiveMutexoperator= (const RecursiveMutex &other)=delete
 copy assignment.
 
 RecursiveMutex (RecursiveMutex &&other)=delete
 move constructor.
 
RecursiveMutexoperator= (RecursiveMutex &&other)=delete
 move assignment.
 
 ~RecursiveMutex ()
 destroys the mutex object.
 
void lock () noexcept
 lock the mutex.
 
bool tryLock () noexcept
 lock the mutex or return immediatly if the mutex is already locked.
 
void unlock () noexcept
 unlock the mutex.
 
pthread_mutex_t * handle () noexcept
 get native handle.
 

Detailed Description

class used to protect shared data from being simultaneously accessed by multiple threads.

Constructor & Destructor Documentation

◆ RecursiveMutex() [1/3]

RecursiveMutex::RecursiveMutex ( )

default constructor.

◆ RecursiveMutex() [2/3]

join::RecursiveMutex::RecursiveMutex ( const Mutex & other)
delete

copy constructor.

Parameters
otherother object to copy.

◆ RecursiveMutex() [3/3]

join::RecursiveMutex::RecursiveMutex ( RecursiveMutex && other)
delete

move constructor.

Parameters
otherother object to move.

◆ ~RecursiveMutex()

RecursiveMutex::~RecursiveMutex ( )

destroys the mutex object.

Member Function Documentation

◆ handle()

pthread_mutex_t * RecursiveMutex::handle ( )
noexcept

get native handle.

Returns
native handle.

◆ lock()

void RecursiveMutex::lock ( )
noexcept

lock the mutex.

◆ operator=() [1/2]

RecursiveMutex & join::RecursiveMutex::operator= ( const RecursiveMutex & other)
delete

copy assignment.

Parameters
otherother object to copy.
Returns
a reference to the current object.

◆ operator=() [2/2]

RecursiveMutex & join::RecursiveMutex::operator= ( RecursiveMutex && other)
delete

move assignment.

Parameters
otherother object to move.
Returns
a reference to the current object.

◆ tryLock()

bool RecursiveMutex::tryLock ( )
noexcept

lock the mutex or return immediatly if the mutex is already locked.

Returns
true if locked, false otherwise.

◆ unlock()

void RecursiveMutex::unlock ( )
noexcept

unlock the mutex.


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