[*] updated comments

This commit is contained in:
Reece Wilson 2023-04-23 19:39:54 +01:00
parent f74a41e286
commit 8dcf857da5

View File

@ -97,8 +97,8 @@ namespace Aurora::Threading::Primitives
bRet = pNtWaitForKeyedEvent(gKeyedEventHandle, &this->wlist, 0, &word) != NTSTATUS_TIMEOUT;
}
else
{
else /* unblock NtReleaseKeyedEvent after an atomic this->wlist change <-> NtReleaseKeyedEvent race condition. */
{ /* this->wlist waiters should still be accounting for us, leading to a NtReleaseKeyedEvent block condition*/
LARGE_INTEGER word;
word.QuadPart = 0;
bRet = pNtWaitForKeyedEvent(gKeyedEventHandle, &this->wlist, 0, &word) != NTSTATUS_TIMEOUT;
@ -125,13 +125,13 @@ namespace Aurora::Threading::Primitives
}
else
{
// in which case we're still dealaing with out overflowed waitlist
// ...and now we might owe NtReleaseKeyedEvent a thread >:(
bRet = false;
continue;
}
}
// go for atomic decrement
// go for an atomic decrement while racing against ::Signal and ::Broadcast
auto waiting = uOld - 1u;
auto uNext = waiting << 2u;