enderalse/SKSE/Plugins/fs_skse_plugin_functions/common/IReadWriteLock.h
2021-10-06 02:45:46 +02:00

25 lines
443 B
C++

#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;
};