casa  $Rev:20696$
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
Public Member Functions | Private Member Functions | Private Attributes
casa::ScopedMutexLock Class Reference

Exception-safe lock/unlock of a mutex. More...

#include <Mutex.h>

List of all members.

Public Member Functions

 ScopedMutexLock (Mutex &mutex)
 Create a lock on the mutex.
 ~ScopedMutexLock ()
 The destructor automatically unlocks the mutex.

Private Member Functions

 ScopedMutexLock (const ScopedMutexLock &)
 Forbid copy constructor.
ScopedMutexLockoperator= (const ScopedMutexLock &)
 Forbid assignment.

Private Attributes

MutexitsMutexRef

Detailed Description

Exception-safe lock/unlock of a mutex.

Intended use:

Public interface

Review Status

Reviewed By:
UNKNOWN
Date Reviewed:
before2004/08/25

Synopsis

The constructor of this class locks a mutex, while the destructor unlocks it. In this way the user does not need to take care of unlocking a mutex and is mutex locking fully exception-safe

Definition at line 97 of file Mutex.h.


Constructor & Destructor Documentation

Create a lock on the mutex.

Definition at line 101 of file Mutex.h.

References itsMutexRef, and casa::Mutex::lock().

The destructor automatically unlocks the mutex.

Definition at line 106 of file Mutex.h.

References itsMutexRef, and casa::Mutex::unlock().

Forbid copy constructor.


Member Function Documentation

ScopedMutexLock& casa::ScopedMutexLock::operator= ( const ScopedMutexLock ) [private]

Forbid assignment.


Member Data Documentation

Definition at line 115 of file Mutex.h.

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


The documentation for this class was generated from the following file: