AuroraRuntime/Source/Loop/LSEvent.NT.cpp
Reece 90e58db0e3 [+] Stubbed out LSAsync
[*] Move classes to headers
2021-10-03 14:19:33 +01:00

51 lines
1.1 KiB
C++

/***
Copyright (C) 2021 J Reece Wilson (a/k/a "Reece"). All rights reserved.
File: LSEvent.NT.cpp
Date: 2021-10-1
Author: Reece
***/
#include <Source/RuntimeInternal.hpp>
#include "LSEvent.hpp"
namespace Aurora::Loop
{
bool Event::Set()
{
return SetEvent(reinterpret_cast<HANDLE>(this->handle));
}
bool Event::Reset()
{
return ResetEvent(reinterpret_cast<HANDLE>(this->handle));
}
bool Event::IsSignaled()
{
return LSHandle::IsSignaled();
}
ELoopSource Event::GetType()
{
return ELoopSource::eSourceEvent;
}
AUKN_SYM AuSPtr<ILSEvent> NewLSEvent(bool triggerd, bool atomicRelease, bool permitMultipleTriggers)
{
AuSPtr<ILSEvent> ret;
auto mutex = CreateEvent(NULL, !atomicRelease, triggerd, NULL);
if (mutex == INVALID_HANDLE_VALUE)
{
SysPushErrorGen("Out of OS resources?");
return {};
}
if (!(ret = AuMakeShared<Event>(mutex)))
{
return {};
}
return ret;
}
}