[*] dont assume these condvar paths cant underflow
This commit is contained in:
parent
3fe2d15a2f
commit
a60a1b3088
@ -37,7 +37,8 @@ namespace Aurora::Threading::Waitables
|
||||
auto uWaiters = this->uAtomicSleeping;
|
||||
auto uWaitCount = 1;
|
||||
|
||||
while (AuAtomicCompareExchange(&this->uAtomicSleeping, uWaiters - uWaitCount, uWaiters) != uWaiters)
|
||||
while (uWaiters &&
|
||||
AuAtomicCompareExchange(&this->uAtomicSleeping, uWaiters - uWaitCount, uWaiters) != uWaiters)
|
||||
{
|
||||
uWaiters = this->uAtomicSleeping;
|
||||
|
||||
@ -74,7 +75,8 @@ namespace Aurora::Threading::Waitables
|
||||
auto uWaiters = this->uAtomicSleeping;
|
||||
auto uWaitCount = 1;
|
||||
|
||||
while (AuAtomicCompareExchange(&this->uAtomicSleeping, uWaiters - uWaitCount, uWaiters) != uWaiters)
|
||||
while (uWaiters &&
|
||||
AuAtomicCompareExchange(&this->uAtomicSleeping, uWaiters - uWaitCount, uWaiters) != uWaiters)
|
||||
{
|
||||
uWaiters = this->uAtomicSleeping;
|
||||
|
||||
|
@ -65,7 +65,8 @@ namespace Aurora::Threading::Primitives
|
||||
auto uWaiters = this->uWaiters_;
|
||||
auto uWaitCount = 1;
|
||||
|
||||
while (AuAtomicCompareExchange(&this->uWaiters_, uWaiters - uWaitCount, uWaiters) != uWaiters)
|
||||
while (uWaiters &&
|
||||
AuAtomicCompareExchange(&this->uWaiters_, uWaiters - uWaitCount, uWaiters) != uWaiters)
|
||||
{
|
||||
uWaiters = this->uWaiters_;
|
||||
|
||||
|
@ -129,7 +129,8 @@ namespace Aurora::Threading::Primitives
|
||||
auto uWaiters = this->uSleeping_;
|
||||
auto uWaitCount = 1;
|
||||
|
||||
while (AuAtomicCompareExchange(&this->uSleeping_, uWaiters - uWaitCount, uWaiters) != uWaiters)
|
||||
while (uWaiters &&
|
||||
AuAtomicCompareExchange(&this->uSleeping_, uWaiters - uWaitCount, uWaiters) != uWaiters)
|
||||
{
|
||||
uWaiters = this->uSleeping_;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user