#include <yateclass.h>
Public Member Functions | |
| Lock (Mutex &mutex, long maxwait=-1) | |
| Lock (Mutex *mutex, long maxwait=-1) | |
| ~Lock () | |
| Mutex * | mutex () const |
| void | drop () |
A lock is a stack allocated (automatic) object that locks a mutex on creation and unlocks it on destruction - typically when exiting a block
|
||||||||||||
|
Create the lock, try to lock the mutex
|
|
||||||||||||
|
Create the lock, try to lock the mutex
|
|
|
Destroy the lock, unlock the mutex if it was locked |
|
|
Unlock the mutex if it was locked and drop the reference to it |
|
|
Return a pointer to the mutex this lock holds
|
1.4.4