mirror of
https://github.com/linux-speakup/espeakup.git
synced 2026-08-20 14:54:17 +02:00
don't wait on a condition variable if should_run is false
This commit is contained in:
parent
633743117c
commit
d5fd5d69b8
1 changed files with 1 additions and 1 deletions
|
|
@ -172,7 +172,7 @@ static void request_espeak_stop(void)
|
|||
pthread_mutex_lock(&queue_guard);
|
||||
runner_must_stop = 1;
|
||||
pthread_cond_signal(&runner_awake); /* Wake runner, if necessary. */
|
||||
while(runner_must_stop == 1)
|
||||
while(should_run && (runner_must_stop == 1))
|
||||
pthread_cond_wait(&stop_acknowledged, &queue_guard); /* wait for acknowledgement. */
|
||||
pthread_mutex_unlock(&queue_guard);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue