Lock guard class. More...
#include <lockguard.h>
Public Types | |
typedef T | mutex_type |
This allows other code to use the type of this mutex in a more safe way. | |
Public Member Functions | |
lock_guard (mutex_type &aMutex) | |
The constructor locks the mutex. More... | |
~lock_guard () | |
The destructor unlocks the mutex. | |
Lock guard class.
The constructor locks the mutex, and the destructor unlocks the mutex, so the mutex will automatically be unlocked when the lock guard goes out of scope. Example usage:
Definition at line 91 of file lockguard.h.
|
inlineexplicit |
The constructor locks the mutex.
aMutex | Any mutex which implements lock() and unlock(). |
Definition at line 99 of file lockguard.h.