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.
This commit is contained in:
William Hubbs 2009-06-25 18:17:14 -05:00
commit 6a15f2cccf

View file

@ -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);