Miosix  2.0alpha1
miosix::Lock< T > Class Template Reference

#include <sync.h>

Public Member Functions

 Lock (T &m)
 
 ~Lock ()
 
T & get ()
 

Detailed Description

template<typename T>
class miosix::Lock< T >

Very simple RAII style class to lock a mutex in an exception-safe way. Mutex is acquired by the constructor and released by the destructor.

Constructor & Destructor Documentation

template<typename T >
miosix::Lock< T >::Lock ( T &  m)
inlineexplicit

Constructor: locks the mutex

Parameters
mmutex to lock
template<typename T >
miosix::Lock< T >::~Lock ( )
inline

Destructor: unlocks the mutex

Member Function Documentation

template<typename T >
T& miosix::Lock< T >::get ( )
inline
Returns
the locked mutex

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