From: Jonathan Patschke Date: Mon, 4 Apr 2016 12:57:52 +0000 (-0500) Subject: Mutex and Condition Variable Initialisation X-Git-Tag: 2.9.5.7~4^2^2 X-Git-Url: http://git.ipfire.org/gitweb/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F265%2Fhead;p=thirdparty%2Fshairport-sync.git Mutex and Condition Variable Initialisation Initialise the mutex and two condition variables inside pc_queue during pc_queue_init(). --- diff --git a/rtsp.c b/rtsp.c index bc6df63a..66cd9b9b 100644 --- a/rtsp.c +++ b/rtsp.c @@ -147,6 +147,9 @@ void ask_other_rtsp_conversation_threads_to_stop(pthread_t except_this_thread); void pc_queue_init(pc_queue *the_queue, char *items, size_t item_size, uint32_t number_of_items) { + pthread_mutex_init(&the_queue->pc_queue_lock, NULL); + pthread_cond_init(&the_queue->pc_queue_item_added_signal, NULL); + pthread_cond_init(&the_queue->pc_queue_item_removed_signal, NULL); the_queue->item_size = item_size; the_queue->items = items; the_queue->count = 0;