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

class used to protect shared data from being simultaneously accessed by multiple process via a shared memory. More...

#include <mutex.hpp>

Public Member Functions

 SharedMutex ()
 default constructor.
 
 SharedMutex (const SharedMutex &other)=delete
 copy constructor.
 
SharedMutexoperator= (const SharedMutex &other)=delete
 copy assignment.
 
 SharedMutex (SharedMutex &&other)=delete
 move constructor.
 
SharedMutexoperator= (SharedMutex &&other)=delete
 move assignment.
 
 ~SharedMutex ()
 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 process via a shared memory.

Constructor & Destructor Documentation

◆ SharedMutex() [1/3]

SharedMutex::SharedMutex ( )

default constructor.

◆ SharedMutex() [2/3]

join::SharedMutex::SharedMutex ( const SharedMutex & other)
delete

copy constructor.

Parameters
otherother object to copy.

◆ SharedMutex() [3/3]

join::SharedMutex::SharedMutex ( SharedMutex && other)
delete

move constructor.

Parameters
otherother object to move.

◆ ~SharedMutex()

SharedMutex::~SharedMutex ( )

destroys the mutex object.

Member Function Documentation

◆ handle()

pthread_mutex_t * SharedMutex::handle ( )
noexcept

get native handle.

Returns
native handle.

◆ lock()

void SharedMutex::lock ( )
noexcept

lock the mutex.

◆ operator=() [1/2]

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

copy assignment.

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

◆ operator=() [2/2]

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

move assignment.

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

◆ tryLock()

bool SharedMutex::tryLock ( )
noexcept

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

Returns
true if locked, false otherwise.

◆ unlock()

void SharedMutex::unlock ( )
noexcept

unlock the mutex.


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