|
Yate
|
Ephemeral double mutex locking object. More...
#include <yateclass.h>
Public Member Functions | |
| Lock2 (Mutex *mx1, Mutex *mx2, long maxwait=-1) | |
| Lock2 (Mutex &mx1, Mutex &mx2, long maxwait=-1) | |
| ~Lock2 () | |
| bool | locked () const |
| bool | lock (Mutex *mx1, Mutex *mx2, long maxwait=-1) |
| bool | lock (Mutex &mx1, Mutex &mx2, long maxwait=-1) |
| void | drop () |
Ephemeral double mutex locking object.
A dual lock is a stack allocated (automatic) object that locks a pair of mutexes on creation and unlocks them on destruction. The mutexes are always locked in the same order to prevent trivial deadlocks
| void drop | ( | ) |
Unlock both mutexes if they were locked and drop the references
Referenced by ~Lock2().
|
inline |
Check if the locking succeeded