[*] Aggressively harden win32 loops against out of memory events

This commit is contained in:
Reece Wilson 2023-09-17 04:08:01 +01:00
parent f928698542
commit 0de153dfe3

View File

@ -367,6 +367,8 @@ namespace Aurora::IO::Loop
{
try
{
AU_DEBUG_MEMCRUNCH;
bool bShouldRebuild {};
for (const auto &re : this->removedSources_)
@ -606,6 +608,8 @@ namespace Aurora::IO::Loop
bool LoopQueue::WaitAll(AuUInt32 timeout)
{
AU_DEBUG_MEMCRUNCH;
AU_LOCK_GUARD(this->rwMutex_->AsReadable());
bool bReturnStatus {false};
@ -933,6 +937,8 @@ namespace Aurora::IO::Loop
bool LoopQueue::WaitAnyNBSpurious(AuUInt64 internalEndTime, AuUInt32 &chuggerIndex, AuList<AuSPtr<ILoopSource>> *trigger, bool poll, bool &bTriggerWin32)
{
AU_DEBUG_MEMCRUNCH;
bool status {};
DWORD temp;
AuUInt32 indexOfTriggered {};
@ -1404,6 +1410,8 @@ namespace Aurora::IO::Loop
void LoopQueue::PumpHooks()
{
AU_DEBUG_MEMCRUNCH;
auto c = AuExchange(this->epilogueHooks_, {});
for (auto &a : c)
{