[*] FutexCondWaitable::NotifyOne was bothering me
This commit is contained in:
parent
610f2c73a0
commit
87c3ac790d
@ -97,18 +97,16 @@ namespace Aurora::Threading::Waitables
|
||||
|
||||
auline void NotifyOne()
|
||||
{
|
||||
AuUInt32 uWaitCount {};
|
||||
AuUInt32 uWaiters {};
|
||||
|
||||
uWaiters = AuAtomicLoad(&this->uAtomicSleeping);
|
||||
if (uWaiters > 0)
|
||||
AuUInt32 uWaiters = AuAtomicLoad(&this->uAtomicSleeping);
|
||||
if (uWaiters == 0)
|
||||
{
|
||||
AuAtomicAdd(&this->uAtomicState, 1u);
|
||||
WakeOnAddress((const void *)&this->uAtomicState);
|
||||
uWaitCount = 1;
|
||||
return;
|
||||
}
|
||||
|
||||
while (AuAtomicCompareExchange(&this->uAtomicSleeping, uWaiters - uWaitCount, uWaiters) != uWaiters)
|
||||
AuAtomicAdd(&this->uAtomicState, 1u);
|
||||
WakeOnAddress((const void *)&this->uAtomicState);
|
||||
|
||||
while (AuAtomicCompareExchange(&this->uAtomicSleeping, uWaiters - 1u, uWaiters) != uWaiters)
|
||||
{
|
||||
uWaiters = this->uAtomicSleeping;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user