145 : lock (lockIn), lockWasSuccessful (acquireLockOnInitialisation && lock.tryEnterRead()) {}
157 bool isLocked() const noexcept {
return lockWasSuccessful; }
160 bool retryLock() noexcept {
return lockWasSuccessful = lock.tryEnterRead(); }
165 bool lockWasSuccessful;
A critical section that allows multiple simultaneous readers.
Automatically locks and unlocks a ReadWriteLock object.
~ScopedReadLock() noexcept
Destructor.
ScopedReadLock(const ReadWriteLock &lock) noexcept
Creates a ScopedReadLock.
Automatically locks and unlocks a ReadWriteLock object.
~ScopedTryReadLock() noexcept
Destructor.
ScopedTryReadLock(ReadWriteLock &lockIn, bool acquireLockOnInitialisation) noexcept
Creates a ScopedTryReadLock.
ScopedTryReadLock(ReadWriteLock &lockIn)
Creates a ScopedTryReadLock and calls ReadWriteLock::tryEnterRead() as soon as it is created.
bool isLocked() const noexcept
Returns true if the mutex was successfully locked.
bool retryLock() noexcept
Retry gaining the lock by calling tryEnter on the underlying lock.