enderalse/source/fs.dll/common/IReadWriteLock.h

25 lines
443 B
C
Raw Normal View History

2021-10-06 00:45:46 +00:00
#pragma once
#include "common/ICriticalSection.h"
#include "common/IEvent.h"
#include "common/IInterlockedLong.h"
class IReadWriteLock
{
public:
IReadWriteLock();
~IReadWriteLock();
void StartRead(void);
void EndRead(void);
void StartWrite(void);
void EndWrite(void);
private:
IEvent readBlocker;
IEvent writeBlocker;
ICriticalSection enterBlocker;
ICriticalSection writeMutex;
IInterlockedLong readCount;
};