![]() | InDesign SDK 20.5 |
#include <IDThreading.h>
Public Member Functions | |
| lock_guard (Mutex &mx) | |
| lock_guard (Mutex &mx, adopt_lock_t) | |
| ~lock_guard () | |
A lock_guard is an object that controls the ownership of an existing mutex object within a scope. It maintains ownership of the mutex object throughout the lock_guard object's lifetime. It does not manage the lifetime of the mutex it references. The behavior of a program is undefined if the mutex referenced by the lock_guard does not exist for the entire lifetime of the lock_guard object.
| inlineexplicit |
Acquires ownership of the specified mutex by calling mx.lock(). PRECONDITION: if Mutex is not a recursive mutex, the calling thread does not own the mutex mx.
| inline |
Adopts ownership of the mutex mx without calling lock(). PRECONDITION: the calling thread owns the mutex mx.
| inline |
Releases the ownership of the mutex by calling mx.unlock(). PRECONDITION: The calling thread must own the mutex.