From ec5516c751070db8183ca464e0740bd8cf46da01 Mon Sep 17 00:00:00 2001 From: Reece Date: Tue, 19 Apr 2022 02:52:11 +0100 Subject: [PATCH] [*] +1 out of at least 2 more WaitAll issues solved [*] Bug fix LSTimer --- Source/Loop/LSTimer.NT.cpp | 2 +- Source/Loop/LoopQueue.NT.cpp | 8 +++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/Source/Loop/LSTimer.NT.cpp b/Source/Loop/LSTimer.NT.cpp index 9c02d7a8..c8643415 100644 --- a/Source/Loop/LSTimer.NT.cpp +++ b/Source/Loop/LSTimer.NT.cpp @@ -85,7 +85,7 @@ namespace Aurora::Loop return true; } - bool ok = AuAtomicAdd(&this->count_, 1) < this->maxIterationsOrZero_; + bool ok = AuAtomicAdd(&this->count_, 1) <= this->maxIterationsOrZero_; if (ok) { this->UpdateTimeInternal(this->targetTime_ + (AuUInt64(this->reschedStepMsOrZero_) * 10'000ULL)); diff --git a/Source/Loop/LoopQueue.NT.cpp b/Source/Loop/LoopQueue.NT.cpp index fcff4657..eb7272c9 100644 --- a/Source/Loop/LoopQueue.NT.cpp +++ b/Source/Loop/LoopQueue.NT.cpp @@ -571,7 +571,7 @@ namespace Aurora::Loop { AU_LOCK_GUARD(this->rwMutex_->AsReadable()); - bool bReturnStatus {true}; + bool bReturnStatus {false}; bool bTimeout {false}; AuUInt32 count {}; AuUInt32 index {}; @@ -672,8 +672,14 @@ namespace Aurora::Loop source.source->OnFinishSleep(); + if (ticked) + { + bReturnStatus |= true; + } + if (bShouldRemove) { + if (source.source->GetType() == ELoopSource::eSourceWin32) { SysPanic("?");