xmltooling  1.5.6
xmltooling::Lock Class Reference

RAII wrapper for a mutex lock. More...

#include <xmltooling/util/Threads.h>

Public Member Functions

 Lock (Mutex *mtx)
 Locks and wraps the designated mutex. More...
 
 Lock (Mutex &mtx)
 Locks and wraps the designated mutex. More...
 
 Lock (const std::auto_ptr< Mutex > &mtx)
 Locks and wraps the designated mutex. More...
 
 Lock (const boost::scoped_ptr< Mutex > &mtx)
 Locks and wraps the designated mutex. More...
 
 ~Lock ()
 Unlocks the wrapped mutex, if any.
 
Mutexrelease ()
 Releases control of the original Mutex and returns it without unlocking it. More...
 

Detailed Description

RAII wrapper for a mutex lock.

Constructor & Destructor Documentation

xmltooling::Lock::Lock ( Mutex mtx)
inline

Locks and wraps the designated mutex.

Parameters
mtxmutex to lock
xmltooling::Lock::Lock ( Mutex mtx)
inline

Locks and wraps the designated mutex.

Parameters
mtxmutex to lock
xmltooling::Lock::Lock ( const std::auto_ptr< Mutex > &  mtx)
inline

Locks and wraps the designated mutex.

Parameters
mtxmutex to lock
xmltooling::Lock::Lock ( const boost::scoped_ptr< Mutex > &  mtx)
inline

Locks and wraps the designated mutex.

Parameters
mtxmutex to lock

Member Function Documentation

Mutex* xmltooling::Lock::release ( )
inline

Releases control of the original Mutex and returns it without unlocking it.

Returns
the original, locked Mutex

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