Vault  4.1
Public Member Functions
VMutexUnlocker Class Reference

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>

Inheritance diagram for VMutexUnlocker:
VMutexLocker

List of all members.

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.

Detailed Description

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.


Constructor & Destructor Documentation

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.

Parameters:
mutexthe VMutex to unlock, or NULL if no action is wanted
unlockInitiallytrue if the lock should be released on construction

Definition at line 65 of file vmutexlocker.cpp.

References VMutexLocker::mIsLocked, and VMutexLocker::unlock().


The documentation for this class was generated from the following files:

Copyright ©1997-2014 Trygve Isaacson. All rights reserved. This documentation was generated with Doxygen.