Miosix  2.01
miosix::Unlock< T > Class Template Reference

#include <sync.h>

Public Member Functions

 Unlock (Lock< T > &l)
 
 Unlock (T &m)
 
 ~Unlock ()
 
T & get ()
 

Detailed Description

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

This class allows to temporarily re unlock a mutex in a scope where it is locked
Example:

Mutex m;
//Mutex unlocked
{
Lock<Mutex> dLock(m);
//Now mutex locked
{
Unlock<Mutex> eLock(dLock);
//Now mutex back unlocked
}
//Now mutex again locked
}
//Finally mutex unlocked

Constructor & Destructor Documentation

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

Constructor, unlock mutex.

Parameters
lthe Lock that locked the mutex.
template<typename T >
miosix::Unlock< T >::Unlock ( T &  m)
inline

Constructor, unlock mutex.

Parameters
ma locked mutex.
template<typename T >
miosix::Unlock< T >::~Unlock ( )
inline

Destructor. Disable back interrupts.

Member Function Documentation

template<typename T >
T& miosix::Unlock< T >::get ( )
inline
Returns
the unlocked mutex

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