class Lock
|
Ephemeral mutex or semaphore locking object. More... |
|
|
Public Methods
- inline Lock (Lockable& lck, long maxwait = -1)
- inline Lock (Lockable* lck, long maxwait = -1)
- inline ~Lock ()
- inline Lockable* locked () const
- inline void drop ()
A lock is a stack allocated (automatic) object that locks a lockable object
on creation and unlocks it on destruction - typically when exiting a block
inline Lock (Lockable& lck, long maxwait = -1)
| Lock |
Create the lock, try to lock the object
Parameters:
lck | Reference to the object to lock
|
maxwait | Time in microseconds to wait, -1 wait forever
|
inline Lock (Lockable* lck, long maxwait = -1)
| Lock |
Create the lock, try to lock the object
Parameters:
lck | Pointer to the object to lock
|
maxwait | Time in microseconds to wait, -1 wait forever
|
Destroy the lock, unlock the mutex if it was locked
inline Lockable* locked ()
| locked |
[const]
Return a pointer to the lockable object this lock holds
Returns: A pointer to a Lockable or NULL if locking failed
Unlock the object if it was locked and drop the reference to it
Generated by: paulc on bussard on Tue Mar 8 18:42:27 2011, using kdoc 2.0a54. |