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