Deskflow 1.22.0.197
Keyboard and mouse sharing utility
Loading...
Searching...
No Matches
Lock Class Reference

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.

Detailed Description

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).

Constructor & Destructor Documentation

◆ Lock() [1/2]

Lock::Lock ( const Mutex * mutex)
explicit

Lock the mutex mutex.

◆ Lock() [2/2]

Lock::Lock ( const CondVarBase * cv)
explicit

Lock the condition variable cv.

◆ ~Lock()

Lock::~Lock ( )

Unlock the mutex or condition variable.


The documentation for this class was generated from the following files: