[*] Minor update to WaitMultipleLoopSourcesEx

This commit is contained in:
Reece Wilson 2023-12-11 23:34:31 +00:00
parent 35fb78787d
commit a3046658fe

View File

@ -176,10 +176,17 @@ namespace Aurora::IO::Loop
{ {
bStatus = entryZero->WaitOn(optTimeoutMS.value()); bStatus = entryZero->WaitOn(optTimeoutMS.value());
} }
else else if (bSpin)
{ {
bStatus = entryZero->IsSignaled(); bStatus = entryZero->IsSignaled();
} }
else
{
auto pSourceEx = AuDynamicCast<Loop::ILoopSourceEx>(entryZero);
bStatus = pSourceEx ?
pSourceEx->IsSignaledNoSpinIfUserland() :
entryZero->IsSignaled();
}
if (!bStatus) if (!bStatus)
{ {
@ -224,9 +231,22 @@ namespace Aurora::IO::Loop
if (bZeroTick) if (bZeroTick)
{ {
if (!lsList[i]->IsSignaled()) if (bSpin)
{ {
break; if (!lsList[i]->IsSignaled())
{
break;
}
}
else
{
auto pSourceEx = AuDynamicCast<Loop::ILoopSourceEx>(lsList[i]);
if (!(pSourceEx ?
pSourceEx->IsSignaledNoSpinIfUserland() :
entryZero->IsSignaled()))
{
break;
}
} }
} }
else else