mirror of
https://github.com/debauchee/barrier.git
synced 2024-11-27 18:47:34 +03:00
23 lines
302 B
C++
23 lines
302 B
C++
|
#include "CLock.h"
|
||
|
#include "CMutex.h"
|
||
|
#include "CCondVar.h"
|
||
|
|
||
|
//
|
||
|
// CLock
|
||
|
//
|
||
|
|
||
|
CLock::CLock(const CMutex* mutex) throw() : m_mutex(mutex)
|
||
|
{
|
||
|
m_mutex->lock();
|
||
|
}
|
||
|
|
||
|
CLock::CLock(const CCondVarBase* cv) throw() : m_mutex(cv->getMutex())
|
||
|
{
|
||
|
m_mutex->lock();
|
||
|
}
|
||
|
|
||
|
CLock::~CLock() throw()
|
||
|
{
|
||
|
m_mutex->unlock();
|
||
|
}
|