[*] Local loopsources werent calling the parents OnTrigger

This commit is contained in:
Reece Wilson 2023-12-01 10:55:24 +00:00
parent f05cafbff7
commit b0a7417d6f
3 changed files with 27 additions and 4 deletions

View File

@ -57,6 +57,7 @@ namespace Aurora::IO::Loop
}
else
{
(void)LSSemaphore::OnTrigger(0);
return false;
}
}
@ -69,6 +70,7 @@ namespace Aurora::IO::Loop
}
else
{
(void)LSSemaphore::OnTrigger(0);
return false;
}
}

View File

@ -37,6 +37,7 @@ namespace Aurora::IO::Loop
{
if (AuAtomicLoad(&this->uAtomicWord) & kFutexBitWake)
{
(void)LSSemaphore::OnTrigger(0);
AuAtomicSub(&this->uAtomicWord, kFutexBitWake);
}

View File

@ -37,6 +37,7 @@ namespace Aurora::IO::Loop
bool LSLocalSemaphore::OnTrigger(AuUInt handle)
{
auto bRet = this->TryTakeNoSpin();
bool bTriggerLater = !bRet;
while (true)
{
@ -51,17 +52,36 @@ namespace Aurora::IO::Loop
{
auto uCount = AuAtomicLoad(&this->uAtomicSemaphore);
if (uOld - 1 == 0 &&
uCount)
if (uOld - 1 == 0)
{
if (uCount)
{
AuAtomicAdd(&this->uAtomicKernelSemaphore, uCount);
LSSemaphore::AddMany(uCount);
}
else
{
(void)LSSemaphore::OnTrigger(0);
bTriggerLater = false;
}
}
else if (uOld || !bRet)
{
(void)LSSemaphore::OnTrigger(0);
bTriggerLater = false;
}
break;
}
}
#if 0
if (bTriggerLater)
{
(void)LSSemaphore::OnTrigger(0);
}
#endif
return bRet;
}