Take a Mutex reference and lock inside a scope and unlock when the scope is exited. More...
#include <Mutex.h>
Inherits atscppapi::noncopyable.
Public Member Functions | |
ScopedMutexLock (Mutex &mutex) | |
Create the scoped mutex lock, once this object is constructed the lock will be held by the thread. | |
~ScopedMutexLock () | |
Unlock the mutex. |
Take a Mutex reference and lock inside a scope and unlock when the scope is exited.
This is an RAII implementation which will lock a mutex at the start of the scope and unlock it when the scope is exited.
Definition at line 119 of file Mutex.h.
atscppapi::ScopedMutexLock::ScopedMutexLock | ( | Mutex & | mutex | ) | [inline, explicit] |
Create the scoped mutex lock, once this object is constructed the lock will be held by the thread.
mutex | a reference to a Mutex. |
Definition at line 125 of file Mutex.h.
References atscppapi::Mutex::lock().
atscppapi::ScopedMutexLock::~ScopedMutexLock | ( | ) | [inline] |