|
// RWCriticalSection.h: interface for the CRWCriticalSection class.
//
//////////////////////////////////////////////////////////////////////
// (c) Jerome Sopocko 2003
// this code worked last time I saw it
//////////////////////////////////////////////////////////////////////
// v1.0 27/10/2003 First release
//////////////////////////////////////////////////////////////////////
#if !defined(AFX_RWCRITICALSECTION_H__A0994F02_8CE5_45CB_975C_C0D1D5F93BF8__INCLUDED_)
#define AFX_RWCRITICALSECTION_H__A0994F02_8CE5_45CB_975C_C0D1D5F93BF8__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
class CRWCriticalSection
{
public:
CRWCriticalSection();
virtual ~CRWCriticalSection();
protected:
HANDLE m_hNobodyIsReading;
HANDLE m_hWritingMutex;
CRITICAL_SECTION m_csReading;
int m_nReaders;
public:
bool LockReader(DWORD dwTimeOut=INFINITE);
void UnlockReader();
bool LockWriter(DWORD dwTimeOut=INFINITE);
void UnlockWriter();
};
#endif // !defined(AFX_RWCRITICALSECTION_H__A0994F02_8CE5_45CB_975C_C0D1D5F93BF8__INCLUDED_)
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
Known as "The Wandering Geek", I have had to often change identities and countries due to the low quality level of the numerous software I have left behind.
Never wrote a software that did more than sorting 3 numbers which actually worked.
Hey but feel free to download my stuff!