From 59a47d1fb4c59ce93b09cee24e43b86a1140170e Mon Sep 17 00:00:00 2001 From: hogliux Date: Wed, 5 Oct 2016 15:31:01 +0100 Subject: [PATCH] Fixed possible dead-lock --- modules/juce_core/native/juce_posix_SharedCode.h | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/modules/juce_core/native/juce_posix_SharedCode.h b/modules/juce_core/native/juce_posix_SharedCode.h index 5dd2888d4f..a73eb5c8f1 100644 --- a/modules/juce_core/native/juce_posix_SharedCode.h +++ b/modules/juce_core/native/juce_posix_SharedCode.h @@ -1252,10 +1252,13 @@ struct HighResolutionTimer::Pimpl { if (thread != 0) { - shouldStop = true; - while (thread != 0 && thread != pthread_self()) + { + // if the timer callback itself calls startTimer then we need + // to override this + shouldStop = true; Thread::yield(); + } } }