mirror of
https://github.com/debauchee/barrier.git
synced 2024-11-27 10:38:48 +03:00
62519b19fe
#includes.
25 lines
280 B
C++
25 lines
280 B
C++
#include "CLock.h"
|
|
#include "CCondVar.h"
|
|
#include "CMutex.h"
|
|
|
|
//
|
|
// CLock
|
|
//
|
|
|
|
CLock::CLock(const CMutex* mutex) :
|
|
m_mutex(mutex)
|
|
{
|
|
m_mutex->lock();
|
|
}
|
|
|
|
CLock::CLock(const CCondVarBase* cv) :
|
|
m_mutex(cv->getMutex())
|
|
{
|
|
m_mutex->lock();
|
|
}
|
|
|
|
CLock::~CLock()
|
|
{
|
|
m_mutex->unlock();
|
|
}
|