class Lock
|
Ephemeral mutex locking object. More... |
|
|
Public Methods
- inline Lock (Mutex &mutex, long long int maxwait = -1)
- inline Lock (Mutex *mutex, long long int maxwait = -1)
- inline ~Lock ()
- inline Mutex * mutex () const
- inline 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
inline Lock (Mutex &mutex, long long int maxwait = -1)
| Lock |
Create the lock, try to lock the mutex
Parameters:
mutex | Reference to the mutex to lock
|
maxait | Time in microseconds to wait for the mutex, -1 wait forever
|
inline Lock (Mutex *mutex, long long int maxwait = -1)
| Lock |
Create the lock, try to lock the mutex
Parameters:
mutex | Pointer to the mutex to lock
|
maxait | Time in microseconds to wait for the mutex, -1 wait forever
|
Destroy the lock, unlock the mutex if it was locked
inline Mutex * mutex ()
| mutex |
[const]
Return a pointer to the mutex this lock holds
Returns: A mutex pointer or NULL if locking failed
Unlock the mutex if it was locked and drop the reference to it
Generated by: kk on nyx on Sat Jun 4 19:29:41 2005, using kdoc 2.0a54. |