Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members  

rwil::ScopedMutex Class Reference

Creates a mutex that automatically Waits and Releases a mutex. More...

#include <Synchronization.h>

List of all members.

Public Methods

 ScopedMutex (Mutex &mutex)
 Create a scoped mutex associated with a particular mutex. More...

 ~ScopedMutex ()
 Destroys the scoped mutex. More...


Private Attributes

Mutexm_mutex
 A reference to the mutex passed to the costructor. More...


Detailed Description

Creates a mutex that automatically Waits and Releases a mutex.

This class waits on the mutex specified in the constructor and releases that mutex when it destructs.

Definition at line 63 of file Synchronization.h.


Constructor & Destructor Documentation

rwil::ScopedMutex::ScopedMutex Mutex   mutex
 

Create a scoped mutex associated with a particular mutex.

This call waits on the specified mutex immediately.

Parameters:
mutex  The mutex to associate with the scope.

Definition at line 111 of file Synchronization.cpp.

References m_mutex.

00111                                         : m_mutex(mutex) 
00112   { 
00113     m_mutex.Wait();
00114   }

rwil::ScopedMutex::~ScopedMutex  
 

Destroys the scoped mutex.

This call releases the mutex specified in the constructor.

Definition at line 115 of file Synchronization.cpp.

References m_mutex.

00116   { 
00117     m_mutex.Release();
00118   }


Member Data Documentation

Mutex& rwil::ScopedMutex::m_mutex [private]
 

A reference to the mutex passed to the costructor.

Definition at line 79 of file Synchronization.h.

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


The documentation for this class was generated from the following files:
Generated on Tue Apr 9 13:53:08 2002 for RWIL - Real World Interface Library by doxygen1.2.12 written by Dimitri van Heesch, © 1997-2001