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
Some checks failed
JUCE Private Push Trigger / JUCE Push Trigger (push) Has been cancelled
This commit is contained in:
parent
980926d4a6
commit
bc4ea1a66f
1 changed files with 3 additions and 0 deletions
|
|
@ -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());
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue