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