diff --git a/Source/Threading/Primitives/AuEvent.cpp b/Source/Threading/Primitives/AuEvent.cpp index b4c173a1..03fb1477 100644 --- a/Source/Threading/Primitives/AuEvent.cpp +++ b/Source/Threading/Primitives/AuEvent.cpp @@ -27,7 +27,7 @@ namespace Aurora::Threading::Primitives bool EventImpl::LockMS(AuUInt64 uTimeout /*=0*/) { - return LockNS(AuMSToNS(uTimeout)); + return this->LockNS(AuMSToNS(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; diff --git a/Source/Threading/Primitives/AuSemaphore.Linux.cpp b/Source/Threading/Primitives/AuSemaphore.Linux.cpp index 562f35ab..de095d34 100644 --- a/Source/Threading/Primitives/AuSemaphore.Linux.cpp +++ b/Source/Threading/Primitives/AuSemaphore.Linux.cpp @@ -101,10 +101,7 @@ namespace Aurora::Threading::Primitives AuAtomicAdd(&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) {