RAII lock guard - locks on construction, unlocks on destruction. More...
#include <Mutex.h>
Public Member Functions | |
| MutexLock (Mutex &m) | |
| Locks m until this guard goes out of scope. | |
| MutexLock (const MutexLock &)=delete | |
| MutexLock & | operator= (const MutexLock &)=delete |
Protected Attributes | |
| Mutex & | mutex |
| The mutex held by this guard. | |
RAII lock guard - locks on construction, unlocks on destruction.
Use this instead of calling Mutex::lock()/unlock() directly wherever possible, so an early return or exception can't leave the mutex held.
|
inlineexplicit |
|
protected |