[*] This was bothering me - 4b0a7c65 cont

This commit is contained in:
Reece Wilson 2023-09-12 21:56:58 +01:00
parent d661363247
commit 6ff27c6855
2 changed files with 8 additions and 11 deletions

View File

@ -27,7 +27,7 @@ namespace Aurora::Threading::Primitives
bool EventImpl::LockMS(AuUInt64 uTimeout /*=0*/)
{
return LockNS(AuMSToNS<AuUInt64>(uTimeout));
return this->LockNS(AuMSToNS<AuUInt64>(uTimeout));
}
bool EventImpl::LockNS(AuUInt64 uTimeout /*=0*/)
@ -35,7 +35,7 @@ namespace Aurora::Threading::Primitives
AuInt64 uStartTime {};
AuInt64 uEndTime {};
if (AtomicIsEventSetLogicNoSpinNoLock())
if (this->AtomicIsEventSetLogicNoSpinNoLock())
{
return true;
}
@ -48,9 +48,9 @@ namespace Aurora::Threading::Primitives
if (gPreferFutexEvent)
{
auto pSleepCounter = GetSleepCounter();
auto pSleepCounter = this->GetSleepCounter();
while (!AtomicIsEventSetLogicNoSpinNoLock())
while (!this->AtomicIsEventSetLogicNoSpinNoLock())
{
bool bStatus {};
EventBits bits;
@ -102,16 +102,16 @@ namespace Aurora::Threading::Primitives
bool EventImpl::LockAbsNS(AuUInt64 uEndTime)
{
if (AtomicIsEventSetLogicNoSpinNoLock())
if (this->AtomicIsEventSetLogicNoSpinNoLock())
{
return true;
}
if (gPreferFutexEvent)
{
auto pSleepCounter = GetSleepCounter();
auto pSleepCounter = this->GetSleepCounter();
while (!AtomicIsEventSetLogicNoSpinNoLock())
while (!this->AtomicIsEventSetLogicNoSpinNoLock())
{
bool bStatus {};
EventBits bits;

View File

@ -101,10 +101,7 @@ namespace Aurora::Threading::Primitives
AuAtomicAdd<AuUInt32>(&this->dwSleeping_, 1u);
auto old = this->dwState_;
//!tryLock (with old in a scope we can access)
while (!((old != 0) &&
(AuAtomicCompareExchange(&this->dwState_, old - 1, old) == old)))
while (!this->TryLockNoSpin())
{
if (uTimeout != 0)
{