#include <PhxLocks.h>
Public Member Functions | |
| LockHolder (const Lock *lock) | |
| Constructs a new lock holder, which takes and holds the mutex. | |
| LockHolder (LockHolder *lockHolder) | |
| Creates a new lock holder that takes over ownership of a lock from another lock holder. | |
| ~LockHolder () | |
| Destructor that releases the lock held by this LockHolder. | |
| void | unlock (void) |
| Explicitly unlocks the mutex held by this LockHolder. | |
This is used as a safe locking mechanism in the presence of exceptions. Pass it the lock to be locked. The constructor will attempt to acquire the lock and will return when it has done so. When this object is destructed the lock will be released.
|
|
Constructs a new lock holder, which takes and holds the mutex.
|
|
|
Creates a new lock holder that takes over ownership of a lock from another lock holder.
|
|
|
Destructor that releases the lock held by this LockHolder. If the ownership of the lock was transferred to another holder, this does nothing. |
|
|
Explicitly unlocks the mutex held by this LockHolder. Once this is called, the lock is released and this holder will do nothing on destruction. |
1.4.2