17 if (mutex_) mutex_->lock();
23 if (mutex_) mutex_->unlock();
29 if (mutex_) mutex_->unlock();
35 if (mutex_) mutex_->lock();
void unlock()
Manually unlocks the mutex if it is not null.
Definition OptionalLock.h:28
~OptionalLock()
Destructor that automatically unlocks the mutex if it exists.
Definition OptionalLock.h:22
void lock()
Manually locks the mutex if it is not null.
Definition OptionalLock.h:34
OptionalLock(std::mutex *m)
Constructs the lock and automatically locks the mutex if it exists.
Definition OptionalLock.h:16