mirror of
https://github.com/debauchee/barrier.git
synced 2024-12-29 14:12:37 +03:00
6aba3a6f57
being listed and they'd have to be added to every one. just doesn't seem worth the trouble.
23 lines
278 B
C++
23 lines
278 B
C++
#include "CLock.h"
|
|
#include "CMutex.h"
|
|
#include "CCondVar.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();
|
|
}
|