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

23 lines
367 B
C++

#pragma once
#include "common/IInterlockedLong.h"
class IEvent
{
public:
static const UInt32 kDefaultTimeout = 1000 * 10;
IEvent();
~IEvent();
bool Block(void);
bool UnBlock(void);
bool Wait(UInt32 timeout = kDefaultTimeout);
bool IsBlocked(void) { return blockCount.Get() > 0; }
private:
HANDLE theEvent;
IInterlockedLong blockCount;
};