From 33f4fe70bc0ab7b2ceffc10e030143db93463094 Mon Sep 17 00:00:00 2001 From: Samuel Thibault Date: Sat, 30 Jun 2018 15:45:24 +0200 Subject: [PATCH] signal: Add missing mutex_lock/unlock around the while loop --- signal.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/signal.c b/signal.c index 102c3cf..3096b30 100644 --- a/signal.c +++ b/signal.c @@ -63,7 +63,9 @@ void *signal_thread(void *arg) printf("espeakup caught signal %d\n", sig); break; } + pthread_mutex_lock(&queue_guard); } + pthread_mutex_unlock(&queue_guard); /* Tell the reader to stop, if it is in a select() call. */ write(PIPE_WRITE_FD, STOP_MSG, strlen(STOP_MSG)); return NULL;