added: Lock class -- locking resources by using Synchro object

the destructor automatically calls Unlock()



git-svn-id: svn://ttmath.org/publicrep/winix/trunk@886 e52654a7-88a9-db11-a3e9-0013d4bc506e
This commit is contained in:
2012-09-11 23:46:00 +00:00
parent 14ae19143f
commit 72013046fc
4 changed files with 88 additions and 1 deletions

37
core/lock.h Executable file
View File

@@ -0,0 +1,37 @@
/*
* This file is a part of Winix
* and is not publicly distributed
*
* Copyright (c) 2012, Tomasz Sowa
* All rights reserved.
*
*/
#ifndef headerfile_winix_core_lock
#define headerfile_winix_core_lock
#include "synchro.h"
class Lock
{
public:
Lock(Synchro * synchro_);
Lock(Synchro & synchro_);
~Lock();
void Unlock();
private:
Synchro * synchro;
Lock();
};
#endif