Files
winix/core/lock.cpp
Tomasz Sowa 7468e7a36c added: namespace Winix over all *.h/*.cpp files
git-svn-id: svn://ttmath.org/publicrep/winix/trunk@948 e52654a7-88a9-db11-a3e9-0013d4bc506e
2014-02-12 16:30:49 +00:00

58 lines
513 B
C++
Executable File

/*
* This file is a part of Winix
* and is not publicly distributed
*
* Copyright (c) 2012-2014, Tomasz Sowa
* All rights reserved.
*
*/
#include "lock.h"
namespace Winix
{
Lock::Lock()
{
synchro = 0;
}
Lock::Lock(Synchro * synchro_)
{
synchro = synchro_;
synchro->Lock();
}
Lock::Lock(Synchro & synchro_)
{
synchro = &synchro_;
synchro->Lock();
}
Lock::~Lock()
{
Unlock();
}
void Lock::Unlock()
{
if( synchro )
{
synchro->Unlock();
synchro = 0;
}
}
} // namespace Winix