glibmm 2.66.5
|
This represents a reader-writer lock. More...
#include <glibmm/threads.h>
Classes | |
class | ReaderLock |
Utility class for exception-safe locking of read/write locks. More... | |
class | WriterLock |
Utility class for exception-safe locking of read/write locks. More... | |
Public Member Functions | |
RWLock () | |
RWLock (const RWLock &)=delete | |
RWLock & | operator= (const RWLock &)=delete |
~RWLock () | |
void | reader_lock () |
bool | reader_trylock () |
void | reader_unlock () |
void | writer_lock () |
bool | writer_trylock () |
void | writer_unlock () |
GRWLock * | gobj () |
This represents a reader-writer lock.
It is similar to a Mutex in that it allows multiple threads to coordinate access to a shared resource.
The difference to a mutex is that a reader-writer lock discriminates between read-only ('reader') and full ('writer') access. While only one thread at a time is allowed write access (by holding the 'writer' lock via writer_lock()), multiple threads can gain simultaneous read-only access (by holding the 'reader' lock via reader_lock()).
Glib::Threads::RWLock::RWLock | ( | ) |
|
delete |
Glib::Threads::RWLock::~RWLock | ( | ) |
|
inline |
void Glib::Threads::RWLock::reader_lock | ( | ) |
bool Glib::Threads::RWLock::reader_trylock | ( | ) |
void Glib::Threads::RWLock::reader_unlock | ( | ) |
void Glib::Threads::RWLock::writer_lock | ( | ) |
bool Glib::Threads::RWLock::writer_trylock | ( | ) |
void Glib::Threads::RWLock::writer_unlock | ( | ) |