[*] This snucked in and i forgot to enable an nt specific fast path

This commit is contained in:
Reece Wilson 2023-10-21 06:25:25 +01:00
parent 18c023acae
commit d910c71ad8

View File

@ -51,7 +51,7 @@ namespace Aurora::IO::Loop
return workerPid.pool->WorkerToLoopSource(workerPid);
}
#if defined(AURORA_PLATFORM_WIN32)
#if defined(AURORA_IS_MODERNNT_DERIVED)
AuList<AuSPtr<ILoopSource>> WaitMultipleOrObjects(const AuList<AuSPtr<ILoopSource>> &objects, AuUInt32 timeout);
#endif
AuList<AuSPtr<ILoopSource>> WaitMultipleOrObjectsFallback(const AuList<AuSPtr<ILoopSource>> &objects, AuUInt32 timeout, bool &bTimeout);
@ -110,7 +110,6 @@ namespace Aurora::IO::Loop
if (!bAny)
{
AuSPtr<Loop::ILoopQueue> pQueue;
auto &entryZero = lsList[0];
if (!entryZero)
@ -133,12 +132,6 @@ namespace Aurora::IO::Loop
if (lsList.size() > 1)
{
pQueue = AuLoop::NewLoopQueue();
if (!pQueue)
{
goto next;
}
for (AU_ITERATE_N_TO_X(i, 1, lsList.size()))
{
AuUInt32 uTimeoutMS {};
@ -186,15 +179,47 @@ namespace Aurora::IO::Loop
}
else
{
auto start = lsList.begin();
auto type = lsList[0];
if (type->GetType() == ELoopSource::eSourceMutex ||
type->GetType() == ELoopSource::eSourceSemaphore)
{
for (AU_ITERATE_N(i, lsList.size()))
{
if (!lsList[i]->IsSignaled())
{
break;
}
start++;
}
}
AuList<AuSPtr<Loop::ILoopSource>> next(start, lsList.end());
bool bTimeout {};
signaled = WaitMultipleOrObjectsFallback(lsList, uTimeoutMS, bTimeout);
#if defined(AURORA_IS_MODERNNT_DERIVED)
signaled = WaitMultipleOrObjects(next, uTimeoutMS);
bTimeout = bTimeout ?
Time::SteadyClockNS() >= uTimeoutEnd :
false;
#else
signaled = WaitMultipleOrObjectsFallback(next, uTimeoutMS, bTimeout);
#endif
signaled.insert(signaled.end(), lsList.begin(), start);
if (bTimeout)
{
return false;
}
#if 0
return true;
#else
return signaled.size();
#endif
}
}