[*] WaitMultipleLoopSourcesEx (any) fixes

This commit is contained in:
Reece Wilson 2024-09-09 12:40:49 +01:00
parent 634eb35959
commit e62a99777f
2 changed files with 56 additions and 40 deletions

View File

@ -126,7 +126,18 @@ namespace Aurora::IO::Loop
AuUInt lastHandle {};
bool wasTriggered {};
// first handle in group
if (source->Singular())
{
auto handle = source->GetHandle();
if ((firstTriggered == handle) ||
(bAllowOthers && WaitForSingleObject(reinterpret_cast<HANDLE>(handle), 0) == WAIT_OBJECT_0))
{
lastHandle = handle;
wasTriggered = true;
}
}
else
{
for (const auto &handle : source->GetHandles())
{
if ((firstTriggered == handle) ||
@ -134,7 +145,8 @@ namespace Aurora::IO::Loop
{
lastHandle = handle;
wasTriggered = true;
continue;
break;
}
}
}

View File

@ -375,7 +375,10 @@ namespace Aurora::IO::Loop
{
bZeroTick |= bool(signalTemp.size());
AuUInt32 uTimeoutMS {};
bool bTooMany {};
do
{
if (uTimeoutEnd)
{
auto uStartTime = Time::SteadyClockNS();
@ -391,7 +394,6 @@ namespace Aurora::IO::Loop
}
}
bool bTooMany {};
#if defined(AURORA_IS_MODERNNT_DERIVED)
if (AuBuild::kCurrentVendor == AuBuild::EVendor::eGenericMicrosoft &&
lsList2.size() < MAXIMUM_WAIT_OBJECTS)
@ -415,6 +417,8 @@ namespace Aurora::IO::Loop
{
bTooMany = true;
}
}
while (!bTimedout && !bTooMany && signaled.empty());
if (bTooMany)
{