1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-01-10 23:44:24 +00:00

HighResolutionTimer: Prevent a race condition in the unit tests
Some checks failed
JUCE Private Push Trigger / JUCE Push Trigger (push) Has been cancelled

This commit is contained in:
Anthony Nicholls 2025-05-09 14:38:01 +01:00 committed by Anthony Nicholls
parent 980926d4a6
commit bc4ea1a66f

View file

@ -366,6 +366,7 @@ public:
beginBehaviourTest ("A timer can be restarted externally, after being stopped internally");
{
WaitableEvent stopTimer;
WaitableEvent timerStopped;
WaitableEvent timerFiredAfterRestart;
@ -374,6 +375,7 @@ public:
switch (++callbackCount)
{
case 1:
stopTimer.wait (maximumTimeoutMs);
timer.stopTimer();
timerStopped.signal();
return;
@ -391,6 +393,7 @@ public:
timer.startTimer (1);
expect (timer.isTimerRunning());
stopTimer.signal();
expect (timerStopped.wait (maximumTimeoutMs));
expect (! timer.isTimerRunning());