[*] 1576f56d cont (i messed up again)

This commit is contained in:
Reece Wilson 2023-12-23 16:55:04 +00:00
parent 71c88316e5
commit a2c8f036e0

View File

@ -30,6 +30,19 @@ namespace Aurora::IO::Loop
{
AuUInt32 uRemMS { INFINITE };
if (timeout)
{
auto uNow = AuTime::SteadyClockNS();
if (uNow < uEndTimeSteady)
{
uRemMS = AuNSToMS<AuUInt64>(uEndTimeSteady - uNow);
}
else
{
uRemMS = 0;
}
}
ret = WaitForSingleObjectEx(reinterpret_cast<HANDLE>(handles.at(0)), uRemMS, true);
if (timeout &&
@ -41,12 +54,6 @@ namespace Aurora::IO::Loop
{
break;
}
uRemMS = AuNSToMS<AuUInt64>(uEndTimeSteady);
if (!uRemMS)
{
break;
}
}
}
while (ret == WAIT_IO_COMPLETION);
@ -74,6 +81,19 @@ namespace Aurora::IO::Loop
{
AuUInt32 uRemMS { INFINITE };
if (timeout)
{
auto uNow = AuTime::SteadyClockNS();
if (uNow < uEndTimeSteady)
{
uRemMS = AuNSToMS<AuUInt64>(uEndTimeSteady - uNow);
}
else
{
uRemMS = 0;
}
}
ret = WaitForMultipleObjectsEx(ntHandles.size(), ntHandles.data(), false, uRemMS, true);
if (ret < WAIT_OBJECT_0)
{
@ -93,12 +113,6 @@ namespace Aurora::IO::Loop
{
break;
}
uRemMS = AuNSToMS<AuUInt64>(uEndTimeSteady);
if (!uRemMS)
{
break;
}
}
}
while (ret == WAIT_IO_COMPLETION);