WithAcquired Class Reference

This class acquires a lock when instantiated and releases it when the destructor is run. More...

#include <lock.h>

List of all members.

Public Member Functions

 WithAcquired (Lock &l)
 Constructs a WithAcquired object by acquiring the given lock.
 ~WithAcquired ()
 The destructor releases the lock.


Detailed Description

This class acquires a lock when instantiated and releases it when the destructor is run.

This can be used to implement locked sections without catching every possible thing and rethrow it as the destructor is always run, when the closure ends.


Constructor & Destructor Documentation

WithAcquired::WithAcquired ( Lock l  )  [inline]

Constructs a WithAcquired object by acquiring the given lock.

Parameters:
l is the lock to be acquired


The documentation for this class was generated from the following file:
Generated on Sat Feb 7 01:26:51 2009 by  doxygen 1.5.1