[*] updated comments
This commit is contained in:
parent
f74a41e286
commit
8dcf857da5
@ -97,8 +97,8 @@ namespace Aurora::Threading::Primitives
|
|||||||
|
|
||||||
bRet = pNtWaitForKeyedEvent(gKeyedEventHandle, &this->wlist, 0, &word) != NTSTATUS_TIMEOUT;
|
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;
|
LARGE_INTEGER word;
|
||||||
word.QuadPart = 0;
|
word.QuadPart = 0;
|
||||||
bRet = pNtWaitForKeyedEvent(gKeyedEventHandle, &this->wlist, 0, &word) != NTSTATUS_TIMEOUT;
|
bRet = pNtWaitForKeyedEvent(gKeyedEventHandle, &this->wlist, 0, &word) != NTSTATUS_TIMEOUT;
|
||||||
@ -125,13 +125,13 @@ namespace Aurora::Threading::Primitives
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// in which case we're still dealaing with out overflowed waitlist
|
// ...and now we might owe NtReleaseKeyedEvent a thread >:(
|
||||||
bRet = false;
|
bRet = false;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// go for atomic decrement
|
// go for an atomic decrement while racing against ::Signal and ::Broadcast
|
||||||
auto waiting = uOld - 1u;
|
auto waiting = uOld - 1u;
|
||||||
auto uNext = waiting << 2u;
|
auto uNext = waiting << 2u;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user