[*] fix posix cont (crit) 3c19c7a5

This commit is contained in:
Reece Wilson 2023-12-30 17:55:32 +00:00
parent 3db7f527f4
commit 4e0c68d7ad

View File

@ -183,6 +183,12 @@ namespace Aurora::Threading::Primitives
while (!this->TryLock())
{
AU_LOCK_GUARD(this->mutex_);
if (this->TryLock())
{
return true;
}
(void)this->cond_.WaitForSignalNsEx(&this->mutex_, 0, true);
}
@ -197,6 +203,12 @@ namespace Aurora::Threading::Primitives
{
AU_LOCK_GUARD(this->mutex_);
if (this->TryLock())
{
return true;
}
(void)this->cond_.WaitForSignalNsEx(&this->mutex_, uTimeout, true);
}
@ -222,11 +234,11 @@ namespace Aurora::Threading::Primitives
if (count > 1)
{
this->cond_.Signal();
this->cond_.Broadcast();
}
else
{
this->cond_.Broadcast();
this->cond_.Signal();
}
}