diff --git a/softsynth.c b/softsynth.c index 35d01fd..d3fe1b1 100644 --- a/softsynth.c +++ b/softsynth.c @@ -170,7 +170,8 @@ static void request_espeak_stop(void) pthread_mutex_lock(&queue_guard); runner_must_stop = 1; pthread_cond_signal(&runner_awake); /* Wake runner, if necessary. */ - pthread_cond_wait(&stop_acknowledged, &queue_guard); + while(runner_must_stop == 1) + pthread_cond_wait(&stop_acknowledged, &queue_guard); /* wait for acknowledgement. */ pthread_mutex_unlock(&queue_guard); }