IBR-DTNSuite 0.6

ibrcommon/ibrcommon/thread/MutexLock.cpp

Go to the documentation of this file.
00001 #include "ibrcommon/config.h"
00002 #include "ibrcommon/thread/MutexLock.h"
00003 
00004 namespace ibrcommon
00005 {
00006         MutexLock::MutexLock(MutexInterface &m) : m_mutex(m)
00007         {
00008                 m_mutex.enter();
00009         }
00010 
00011         MutexLock::~MutexLock()
00012         {
00013                 m_mutex.leave();
00014         }
00015 
00016         IndicatingLock::IndicatingLock(MutexInterface &m, bool &indicator)
00017          : MutexLock(m), _indicator(indicator)
00018         {
00019                 _indicator = true;
00020         }
00021 
00022         IndicatingLock::~IndicatingLock()
00023         {
00024                 _indicator = false;
00025         }
00026 }