Fix mutex lock/unlock

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello William,

While looking at the speakup source code I noticed a missing
mutex_lock/unlock pair, please see the attached patch.

Samuel
signal: Add missing mutex_lock/unlock around the while loop

---
 signal.c |    2 ++
 1 file changed, 2 insertions(+)

--- 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;
_______________________________________________
Speakup mailing list
Speakup@xxxxxxxxxxxxxxxxx
http://linux-speakup.org/cgi-bin/mailman/listinfo/speakup

[Index of Archives]     [Linux for the Blind]     [Fedora Discussioin]     [Linux Kernel]     [Yosemite News]     [Big List of Linux Books]

  Powered by Linux