Main Page | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Class Members | File Members | Related Pages

ScopedLock Class Reference

List of all members.

Public Member Functions

 this (Lock lock)
 ~this ()

Private Attributes

Lock lock

Detailed Description

A wrapper around a lock which acquires the lock during construction and guarantees the lock is released at the end of the current scope. Use a ScopedLock when you need the Lock equivalent of synchronized statements. For example

 void example(Lock lock) {
   auto ScopedLock slock = new ScopedLock(lock); // acquires lock 
   // the lock will be released at function exit 
 } 

Definition at line 204 of file Lock.d.


Constructor & Destructor Documentation

~this  )  [inline]
 

Definition at line 206 of file Lock.d.

References lock, and Lock::unlock().


Member Function Documentation

this Lock  lock  )  [inline]
 

Definition at line 205 of file Lock.d.

References Lock::lock(), and lock.


Member Data Documentation

Lock lock [private]
 

Definition at line 207 of file Lock.d.

Referenced by this(), and ~this().


The documentation for this class was generated from the following file:
Generated on Sat Dec 24 17:28:41 2005 for Mango by  doxygen 1.4.0