diff --git a/Source/RNG/AuRandomDevice.cpp b/Source/RNG/AuRandomDevice.cpp index 015c2aba..a044e9b4 100644 --- a/Source/RNG/AuRandomDevice.cpp +++ b/Source/RNG/AuRandomDevice.cpp @@ -282,7 +282,7 @@ namespace Aurora::RNG double RandomDevice::NextDecimal() { - return this->UniformFloatInRange(0.0, 1.0); + return this->UniformFloatInRange(DBL_EPSILON, 1.0); } AuUInt32 RandomDevice::NextIndex(AuUInt32 uCount /* = max + 1*/) @@ -299,8 +299,8 @@ namespace Aurora::RNG double RandomDevice::NextNumber(double dMin, double dMax) { - auto dRange = dMin - dMin; - return this->UniformFloatInRange(0.0, dRange) + dMin; + auto dRange = dMax - dMin; + return this->UniformFloatInRange(DBL_EPSILON, dRange + DBL_EPSILON) + dMin - DBL_EPSILON; } AuMemoryViewRead RandomDevice::ToSeed() diff --git a/Source/Threading/Primitives/AuConditionEx.cpp b/Source/Threading/Primitives/AuConditionEx.cpp index f689d29b..368853dc 100644 --- a/Source/Threading/Primitives/AuConditionEx.cpp +++ b/Source/Threading/Primitives/AuConditionEx.cpp @@ -45,7 +45,7 @@ namespace Aurora::Threading::Primitives } bool SemaphoreConditionVariableImpl::WaitForSignalAbsNS(const AuSPtr &pWaitable, - AuUInt64 uRelativeNanoseconds) + AuUInt64 uNanoseconds) { AuAtomicAdd(&this->uWaiters_, 1u); @@ -54,7 +54,7 @@ namespace Aurora::Threading::Primitives pWaitable->Unlock(); } - auto bSuccess = this->s_.LockAbsNS(uRelativeNanoseconds); + auto bSuccess = this->s_.LockAbsNS(uNanoseconds); if (!bSuccess) { auto uWaiters = this->uWaiters_; diff --git a/Source/Threading/Primitives/AuRWLock.cpp b/Source/Threading/Primitives/AuRWLock.cpp index f0650408..b185de6f 100644 --- a/Source/Threading/Primitives/AuRWLock.cpp +++ b/Source/Threading/Primitives/AuRWLock.cpp @@ -934,7 +934,6 @@ namespace Aurora::Threading::Primitives return &this->write_; } - template bool RWLockImpl::CheckSelfThreadIsWriter() {