A scoped lock that references a shared mutex. Does a shared read lock on construction and unlocks on destruction.
More...
|
| | SharedLock () |
| |
| | SharedLock (Lockable &lock, lock::Op op=lock::Op::lock) |
| |
| template<class Rep , class Period > |
| | SharedLock (Lockable &lock, Duration< Rep, Period > time) |
| |
| template<class Clock , class Dur > |
| | SharedLock (Lockable &lock, TimePoint< Clock, Dur > time) |
| |
| | SharedLock (SharedLock &&rhs) noexcept |
| |
| | SharedLock (UniqueLock< Lockable > &&rhs) |
| | Atomically unlock unique writer lock and acquire shared reader lock without blocking. The unique lock is released. More...
|
| |
| | ~SharedLock () |
| |
| SharedLock & | operator= (SharedLock &&rhs) |
| |
| SharedLock & | operator= (UniqueLock< Lockable > &&rhs) |
| |
| void | lock () |
| |
| void | unlock () |
| |
| bool | tryLock () |
| |
| template<class Rep , class Period > |
| bool | tryLock (Duration< Rep, Period > time) |
| |
| template<class Clock , class Dur > |
| bool | tryLock (TimePoint< Clock, Dur > time) |
| |
| bool | owns () const |
| |
| | operator bool () const |
| |
| Lockable & | mutex () |
| |
| Lockable & | release () |
| |
template<class Lockable_>
class honey::SharedLock< Lockable_ >
A scoped lock that references a shared mutex. Does a shared read lock on construction and unlocks on destruction.
Instances are non-recursive (can't lock an instance twice), and can only be manipulated by one thread.
Note that if recursion is required, multiple instances can reference the same recursive lockable.