7#include <condition_variable>
22 std::mutex WriteMutex, ReadMutex;
23 std::atomic_int ReadCounter;
24 std::atomic_bool IsCondVarWaiting;
25 std::condition_variable Cv;
122 template <
class Mutex>
126 Mutex* Mtx =
nullptr;
194 template <
class Mutex>
198 Mutex* Mtx =
nullptr;
Iterator class for all library maps.
Definition Map.h:18
A class for blocking a stream for reading.
Definition ReadWriteMutex.h:124
~ReadLock() noexcept
Destructor.
Definition ReadWriteMutex.h:179
ReadLock< Mutex > & operator=(ReadLock< Mutex > &&other) noexcept=delete
Deleted move assignment operator.
ReadLock() noexcept=delete
Deleted default constructor.
ReadLock< Mutex > & operator=(const ReadLock< Mutex > &other) noexcept=delete
Deleted assignment operator.
A class for synchronizing threads.
Definition ReadWriteMutex.h:20
ReadWriteMutex() noexcept
Default constructor.
Definition ReadWriteMutex.cpp:5
void ReadLock() noexcept
A method for locking a section of code for reading.
Definition ReadWriteMutex.cpp:16
void WriteLock() noexcept
A method for locking a section of code for writing.
Definition ReadWriteMutex.cpp:43
void WriteUnlock() noexcept
A method for unlocking a section of code for writing.
Definition ReadWriteMutex.cpp:60
void ReadUnlock() noexcept
A method for unlocking a section of code for reading.
Definition ReadWriteMutex.cpp:28
void Disable() noexcept
A function to disable the mutex. It is needed so that you can disable the mutex during inheritance.
Definition ReadWriteMutex.cpp:11
A class for synchronizing threads.
Definition ReadWriteMutex.h:71
void ReadLock() noexcept
A method for locking a section of code for reading.
Definition ReadWriteMutex.cpp:76
void WriteUnlock() noexcept
A method for unlocking a section of code for writing.
Definition ReadWriteMutex.cpp:120
void WriteLock() noexcept
A method for locking a section of code for writing.
Definition ReadWriteMutex.cpp:104
void Disable() noexcept
A function to disable the mutex. It is needed so that you can disable the mutex during inheritance.
Definition ReadWriteMutex.cpp:71
void ReadUnlock() noexcept
A method for unlocking a section of code for reading.
Definition ReadWriteMutex.cpp:90
A class for blocking a stream for writing.
Definition ReadWriteMutex.h:196
~WriteLock() noexcept
Destructor.
Definition ReadWriteMutex.h:251
WriteLock() noexcept=delete
Deleted default constructor.
WriteLock< Mutex > & operator=(WriteLock< Mutex > &&other) noexcept=delete
Deleted move assignment operator.
WriteLock< Mutex > & operator=(const WriteLock< Mutex > &other) noexcept=delete
Deleted assignment operator.