From b5c775210f3a423ab88fb50e9df6784a9ae249b8 Mon Sep 17 00:00:00 2001 From: attila Date: Tue, 20 Dec 2022 13:55:37 +0100 Subject: [PATCH] HighResolutionTimer: Ensure that a new interval applies from the moment of calling startTimer() Before this commit an already started timer would wait until the previously set tick time before applying the new one. This problem seems to have affected the Windows implementation only. --- modules/juce_core/threads/juce_HighResolutionTimer.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/modules/juce_core/threads/juce_HighResolutionTimer.cpp b/modules/juce_core/threads/juce_HighResolutionTimer.cpp index e0f00e240e..002ebf7612 100644 --- a/modules/juce_core/threads/juce_HighResolutionTimer.cpp +++ b/modules/juce_core/threads/juce_HighResolutionTimer.cpp @@ -45,6 +45,8 @@ public: nextTickTime = steady_clock::now() + milliseconds (periodMillis); } + waitEvent.notify_one(); + if (! isThreadRunning()) startThread (Thread::Priority::high); }