![]() |
Vault
4.1
|
VMutexUnlocker is helper class that is the inverse of a VMutexLocker: it unlocks a mutex upon construction, and locks it upon destruction. More...
#include <vmutexlocker.h>
Public Member Functions | |
VMutexUnlocker (VMutex *mutex, bool unlockInitially=true) | |
Constructs the unlocker, and if specified, releases the mutex lock. | |
virtual | ~VMutexUnlocker () |
Destructor, re-locks the mutex if this object has released it. |
VMutexUnlocker is helper class that is the inverse of a VMutexLocker: it unlocks a mutex upon construction, and locks it upon destruction.
The unlocker presumes that the mutex is locked to begin with.
Definition at line 139 of file vmutexlocker.h.
VMutexUnlocker::VMutexUnlocker | ( | VMutex * | mutex, |
bool | unlockInitially = true |
||
) |
Constructs the unlocker, and if specified, releases the mutex lock.
It is presumed by this class that the mutex is locked when this object is constructed.
You can pass NULL to constructor if you don't want anything to happen; this can useful if, for example, you allow a NULL VMutex pointer to be passed to a routine that needs to unlock it if supplied.
mutex | the VMutex to unlock, or NULL if no action is wanted |
unlockInitially | true if the lock should be released on construction |
Definition at line 65 of file vmutexlocker.cpp.
References VMutexLocker::mIsLocked, and VMutexLocker::unlock().