Main Page Modules Namespace List Class Hierarchy Compound List Namespace Members Compound Members Related Pages
GNE::Lock< T > Class Template Reference
[Threading API]
#include <Lock.h>
List of all members.
|
Public Member Functions |
| Lock (T &objToLock) |
Detailed Description
template<class T>
class GNE::Lock< T >
A small helper class that locks the object in its ctor and unlocks it in its destructor. This is handy if a largish function has multiple exit points espically if it throws exceptions. This class makes sure that once you lock the object it will be unlocked when you leave the scope.
A Lock instance may not be copied, and you must specify a object to lock in its constructor.
Lock objects can work for any object that has the methods "acquire" and "release". In GNE these are Mutexes, ConditionVariables, and classes that inherit from SynchronizedObject.
- See also:
- LockMutex
LockObject
LockCV
The documentation for this class was generated from the following file:
Generated on Fri Aug 22 13:40:06 2003 for GNE by
1.3