GNE::Lock< T > Class Template Reference
[Threading API]

A small helper class that locks the object in its ctor and unlocks it in its destructor. More...

#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 Thu Dec 24 18:43:49 2009 for GNE by  doxygen 1.6.1