Deskflow 1.22.0.197
Keyboard and mouse sharing utility
|
Mutual exclusion lock utility. More...
#include <Lock.h>
Public Member Functions | |
Lock (const Mutex *mutex) | |
Lock the mutex mutex . | |
Lock (const CondVarBase *cv) | |
Lock the condition variable cv . | |
~Lock () | |
Unlock the mutex or condition variable. |
Mutual exclusion lock utility.
This class locks a mutex or condition variable in the c'tor and unlocks it in the d'tor. It's easier and safer than manually locking and unlocking since unlocking must usually be done no matter how a function exits (including by unwinding due to an exception).
|
explicit |
Lock the condition variable cv
.
Lock::~Lock | ( | ) |
Unlock the mutex or condition variable.