[*] Fix posix WoASemaphoreImpl
This commit is contained in:
parent
ba6162a7ad
commit
3c19c7a56e
@ -152,7 +152,7 @@ namespace Aurora::Threading::Primitives
|
||||
|
||||
WoASemaphoreImpl::~WoASemaphoreImpl()
|
||||
{
|
||||
::pthread_cond_destroy(&this->pthreadCv_);
|
||||
|
||||
}
|
||||
|
||||
bool WoASemaphoreImpl::HasOSHandle(AuMach &mach)
|
||||
@ -182,6 +182,7 @@ namespace Aurora::Threading::Primitives
|
||||
{
|
||||
while (!this->TryLock())
|
||||
{
|
||||
AU_LOCK_GUARD(this->mutex_);
|
||||
(void)this->cond_.WaitForSignalNsEx(&this->mutex_, 0, true);
|
||||
}
|
||||
|
||||
@ -194,7 +195,11 @@ namespace Aurora::Threading::Primitives
|
||||
return true;
|
||||
}
|
||||
|
||||
(void)this->cond_.WaitForSignalNsEx(&this->mutex_, uTimeout, true);
|
||||
{
|
||||
AU_LOCK_GUARD(this->mutex_);
|
||||
(void)this->cond_.WaitForSignalNsEx(&this->mutex_, uTimeout, true);
|
||||
}
|
||||
|
||||
return this->TryLock();
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user