[*] IOSubmit.Linux.cpp bugfix: save wasted time cancelling triggered polls resulting in a -1 EINVAL

This commit is contained in:
Reece Wilson 2022-08-10 17:22:25 +01:00
parent 868de46abd
commit f98174b7a2

View File

@ -685,16 +685,18 @@ namespace Aurora::IO::UNIX
} while (timeout ? !bEpollTriggered : false);
io_event finalEpollEvent;
if (io_cancel(io->context, ptr, &finalEpollEvent) == 0)
io_event finalEpollEvent {};
if ((bEpollTriggered) ||
(io_cancel(io->context, ptr, &finalEpollEvent) == 0))
{
// TODO (Reece): if finalEpollEvent.res == 1, bEpollTriggered = true?
}
else
{
// Do I care?
//SysPushErrorIO();
SysPushErrorIO();
// I don't
// I do again
}
if (bEpollTriggered)
@ -843,7 +845,21 @@ namespace Aurora::IO::UNIX
for (int i = 0; i < iocbIdx; i++)
{
io_event finalEpollEvent;
io_event finalEpollEvent {};
if (i == 0)
{
if ((bReadTriggered) ||
((read == -1) && (bWriteTriggered)))
{
continue;
}
}
else if ((i == 1) && (bWriteTriggered))
{
continue;
}
if (io_cancel(io->context, ptrArray[i], &finalEpollEvent) == 0)
{
// TODO (Reece): if finalEpollEvent.res == 1, bEpollTriggered = true?
@ -851,8 +867,9 @@ namespace Aurora::IO::UNIX
else
{
// Do I care?
//SysPushErrorIO();
SysPushErrorIO();
// I don't
// I do again
}
}