Lely core libraries 2.3.4
|
A mutex wrapper that provides a convenient RAII-style mechanism for releasing a mutex for the duration of a scoped block. More...
#include <mutex.hpp>
Public Types | |
typedef Mutex | MutexType |
The type of the mutex to unlock. | |
Public Member Functions | |
UnlockGuard (MutexType &m) | |
Releases ownership of m and calls m.unlock() . | |
UnlockGuard (MutexType &m, ::std::adopt_lock_t) | |
Releases ownership of m without attempting to unlock it. | |
~UnlockGuard () | |
Acquires ownership of m and calls m.lock() , where m is the mutex passed to the constructor. | |
A mutex wrapper that provides a convenient RAII-style mechanism for releasing a mutex for the duration of a scoped block.
When an UnlockGuard
object is created, it attempts to release ownership of the mutex it is given. When control leaves the scope in which the UnlockGuard
object was created, the UnlockGuard
is destructed and the mutex reacquired.
The type of the mutex to unlock.
The type must meet the BasicLockable requirements.
|
inlineexplicit |
|
inline |