windows-nt/Source/XPSP1/NT/multimedia/directx/dplay/dnet/common/readwritelock.h

31 lines
530 B
C
Raw Normal View History

2020-09-26 03:20:57 -05:00
// ReadWriteLock.h: interface for the CReadWriteLock class.
//
//////////////////////////////////////////////////////////////////////
#pragma once
class CReadWriteLock
{
public:
CReadWriteLock();
~CReadWriteLock();
BOOL Init();
void EnterWriteLock();
void EnterReadLock();
void LeaveLock();
private:
int m_nWriterWaitingCount;
int m_nReaderWaitingCount;
int m_nActiveCount;
HANDLE m_hWriteSem;
HANDLE m_hReadSem;
BOOL m_fCritSecInited;
DNCRITICAL_SECTION m_csWrite;
DEBUG_ONLY(DWORD m_dwWriteThread);
};