OpenDaVINCI  4.15.3
odcore::base::Lock Class Reference

#include <Lock.h>

Public Member Functions

 Lock (Mutex &mutex)
 
virtual ~Lock ()
 
 Lock (std::shared_ptr< odcore::wrapper::SharedMemory > sp)
 

Detailed Description

This class implements an automatic locking mechanism for mutexes. If the control leaves the scope wherein this lock was defined, the mutex is automatically released.

void foo() {
Lock l(m_mutex);
...
}

Constructor & Destructor Documentation

odcore::base::Lock::Lock ( Mutex mutex)

Constructor.

Parameters
mutexMutex to be automagically locked.

References odcore::base::Mutex::lock().

odcore::base::Lock::~Lock ( )
virtual
odcore::base::Lock::Lock ( std::shared_ptr< odcore::wrapper::SharedMemory sp)

Constructor.

Parameters
mutexMutex to be automagically locked.