mirror of
https://github.com/debauchee/barrier.git
synced 2026-02-09 21:25:55 +08:00
Started over.
This commit is contained in:
22
mt/CLock.cpp
Normal file
22
mt/CLock.cpp
Normal file
@@ -0,0 +1,22 @@
|
||||
#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();
|
||||
}
|
||||
Reference in New Issue
Block a user