From 6a15f2cccf4d98e112f09ae64e68773c028b76f6 Mon Sep 17 00:00:00 2001 From: William Hubbs Date: Thu, 25 Jun 2009 18:17:14 -0500 Subject: [PATCH] fixed first wait in softsynth thread The thread should wait if there is nothing in the queue and if there is not a request to stop. Thanks to Chris Brannon for the patch. --- synth.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/synth.c b/synth.c index 2ec8f1e..58e111b 100644 --- a/synth.c +++ b/synth.c @@ -257,7 +257,9 @@ void *espeak_thread(void *arg) pthread_mutex_lock(&queue_guard); while (should_run) { - pthread_cond_wait(&runner_awake, &queue_guard); + + while (should_run && !queue_peek() && !runner_must_stop) + pthread_cond_wait(&runner_awake, &queue_guard); while (should_run && queue_peek() && !runner_must_stop) { queue_process_entry(s);