barrier/mt/CLock.cpp

23 lines
278 B
C++
Raw Normal View History

2001-10-06 18:13:28 +04:00
#include "CLock.h"
#include "CMutex.h"
#include "CCondVar.h"
//
// CLock
//
CLock::CLock(const CMutex* mutex) : m_mutex(mutex)
2001-10-06 18:13:28 +04:00
{
m_mutex->lock();
}
CLock::CLock(const CCondVarBase* cv) : m_mutex(cv->getMutex())
2001-10-06 18:13:28 +04:00
{
m_mutex->lock();
}
CLock::~CLock()
2001-10-06 18:13:28 +04:00
{
m_mutex->unlock();
}