Equalizer 1.0

co::base::ScopedMutex< L > Class Template Reference

A scoped mutex. More...

#include <scopedMutex.h>

Inheritance diagram for co::base::ScopedMutex< L >:
Collaboration diagram for co::base::ScopedMutex< L >:

List of all members.

Public Member Functions

 ScopedMutex (L *lock)
 Construct a new scoped mutex and set the given lock.
 ScopedMutex (L &lock)
 Construct a new scoped mutex and set the given lock.
template<typename LB >
 ScopedMutex (LB &lockable)
 Construct a new scoped mutex for the given Lockable data structure.
 ~ScopedMutex ()
 Destruct the scoped mutex and unset the mutex.
void leave ()
 Leave and unlock the mutex immediately.

Detailed Description

template<class L = Lock>
class co::base::ScopedMutex< L >

A scoped mutex.

The mutex is automatically set upon creation, and released when the scoped mutex is destroyed, e.g., when the scope is left. The scoped mutex does nothing if a 0 pointer for the lock is passed.

Definition at line 37 of file scopedMutex.h.


Constructor & Destructor Documentation

template<class L = Lock>
co::base::ScopedMutex< L >::ScopedMutex ( L *  lock) [inline, explicit]

Construct a new scoped mutex and set the given lock.

Providing no Lock (0) is allowed, in which case the scoped mutex does nothing.

Parameters:
lockthe mutex to set and unset, or 0.
Version:
1.0

Definition at line 49 of file scopedMutex.h.

template<class L = Lock>
co::base::ScopedMutex< L >::ScopedMutex ( L &  lock) [inline, explicit]

Construct a new scoped mutex and set the given lock.

Version:
1.0

Definition at line 53 of file scopedMutex.h.

template<class L = Lock>
template<typename LB >
co::base::ScopedMutex< L >::ScopedMutex ( LB &  lockable) [inline]

Construct a new scoped mutex for the given Lockable data structure.

Version:
1.0

Definition at line 60 of file scopedMutex.h.

template<class L = Lock>
co::base::ScopedMutex< L >::~ScopedMutex ( ) [inline]

Destruct the scoped mutex and unset the mutex.

Version:
1.0

Definition at line 64 of file scopedMutex.h.

References co::base::ScopedMutex< L >::leave().

Here is the call graph for this function:


Member Function Documentation

template<class L = Lock>
void co::base::ScopedMutex< L >::leave ( ) [inline]

Leave and unlock the mutex immediately.

Version:
1.0

Definition at line 67 of file scopedMutex.h.

Referenced by co::base::ScopedMutex< L >::~ScopedMutex().

Here is the caller graph for this function:


The documentation for this class was generated from the following file:
Generated on Sun May 8 2011 19:11:09 for Equalizer 1.0 by  doxygen 1.7.3