libfilezilla
|
A simple scoped read lock. More...
#include <rwmutex.hpp>
Public Member Functions | |
scoped_read_lock (rwmutex &m) | |
scoped_read_lock (scoped_read_lock const &)=delete | |
scoped_read_lock & | operator= (scoped_read_lock const &)=delete |
scoped_read_lock (scoped_read_lock &&op) noexcept | |
scoped_read_lock & | operator= (scoped_read_lock &&op) noexcept |
void | lock () |
Obtains the mutex. More... | |
void | unlock () |
Releases the mutex. More... | |
A simple scoped read lock.
The lock is acquired on construction and, if still locked, released on destruction. You can manually unlock and re-lock if needed.
There can be multiple readers. If there is a writer there's no readers and no other writer.
|
inline |
Obtains the mutex.
Locking an already locked scoped_read_lock results in undefined behavior.
|
inline |
Releases the mutex.
Releasing a scoped_read_lock that isn't locked results in undefined behavior.