25#ifndef JOIN_CORE_MUTEX_HPP
26#define JOIN_CORE_MUTEX_HPP
43 explicit Mutex (
bool inherit =
false);
79 void lock () noexcept;
96 pthread_mutex_t*
handle () noexcept;
100 pthread_mutex_t _handle;
149 void lock () noexcept;
166 pthread_mutex_t*
handle () noexcept;
170 pthread_mutex_t _handle;
220 void lock () noexcept;
237 pthread_mutex_t*
handle () noexcept;
241 pthread_mutex_t _handle;
247 template <typename Lockable>
class used to protect shared data from being simultaneously accessed by multiple threads.
Definition mutex.hpp:37
Mutex(Mutex &&other)=delete
move constructor.
pthread_mutex_t * handle() noexcept
get native handle.
Definition mutex.cpp:94
void unlock() noexcept
unlock the mutex.
Definition mutex.cpp:85
Mutex & operator=(const Mutex &other)=delete
copy assignment.
bool tryLock() noexcept
lock the mutex or return immediatly if the mutex is already locked.
Definition mutex.cpp:76
void lock() noexcept
lock the mutex.
Definition mutex.cpp:67
Mutex(bool inherit=false)
default constructor.
Definition mutex.cpp:42
~Mutex()
destroys the mutex object.
Definition mutex.cpp:58
Mutex(const Mutex &other)=delete
copy constructor.
class used to protect shared data from being simultaneously accessed by multiple threads.
Definition mutex.hpp:107
RecursiveMutex(const Mutex &other)=delete
copy constructor.
RecursiveMutex(RecursiveMutex &&other)=delete
move constructor.
class owning a mutex for the duration of a scoped block.
Definition mutex.hpp:249
ScopedLock()=delete
default constructor.
Lockable * mutex() const
get associated mutex.
Definition mutex.hpp:304
ScopedLock(const ScopedLock &other)=delete
copy constructor.
ScopedLock(ScopedLock &&other)=delete
move constructor.
~ScopedLock()
releases the ownership of the owned mutex.
Definition mutex.hpp:295
ScopedLock(Lockable &mutex)
acquires ownership of the given mutex.
Definition mutex.hpp:260
class used to protect shared data from being simultaneously accessed by multiple process via a shared...
Definition mutex.hpp:178
SharedMutex(const SharedMutex &other)=delete
copy constructor.
SharedMutex(SharedMutex &&other)=delete
move constructor.
Definition acceptor.hpp:32