AuroraRuntime/Include/Aurora/Threading/Primitives/Event.hpp
Reece Wilson 124038df62 [*] Refactor public headers
[+] AuConsole::Commands::RemoveCommand
[+] EExtendedUsage::eServerAuth
[+] SysPanic2 for SysSafeLine hints (backtrace may contain optimized SysPanics, making tracing the true origin difficult)
[*] Reworked SysAssertions
[*] AuParse::EncodeHex now takes AuMemoryViewRead
[*] AuRng::ReadSecureRNG now takes AuMemoryViewWrite
[*] AuRng::ReadFastRNG now takes AuMemoryViewWrite
2023-01-15 06:05:22 +00:00

38 lines
1.0 KiB
C++

/***
Copyright (C) 2021 J Reece Wilson (a/k/a "Reece"). All rights reserved.
File: Event.hpp
Date: 2021-6-9
Author: Reece
***/
#pragma once
namespace Aurora::Threading::Primitives
{
/**
Event synchronization primitive
*/
struct IEvent : IWaitable
{
// Unlike the other types, unlock is always a nop. It makes sense the caller to not automatically reset an event, contrary to `::Lock(); work; ::Unlock();`
// Ordinarily, we would expect the thread responsible for work processing to ::Lock/::Unlock (maybe ::Reset()), and the dispatching thread to ::Reset and ::Set.
inline void Wait()
{
Lock();
}
inline void Wait(AuUInt32 ms)
{
Lock(ms);
}
virtual void Reset() = 0;
virtual void Set() = 0;
};
AUKN_SHARED_API(Event, IEvent,
bool bInitiallyTriggerd = false,
bool bAtomicRelease = true,
bool bPermitMultipleTriggers = false);
}