From 79c1b4904be7ceac4c10a92f6145b1cf18e7e967 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20=C3=96man?= Date: Sun, 3 Jun 2012 10:55:31 +0200 Subject: [PATCH] htsp: Add missing lock when flushing HTSP output queue Fixes #996 --- src/htsp.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/htsp.c b/src/htsp.c index 1a630fa7..af897f07 100644 --- a/src/htsp.c +++ b/src/htsp.c @@ -217,6 +217,8 @@ htsp_flush_queue(htsp_connection_t *htsp, htsp_msg_q_t *hmq) { htsp_msg_t *hm; + pthread_mutex_lock(&htsp->htsp_out_mutex); + if(hmq->hmq_length) TAILQ_REMOVE(&htsp->htsp_active_output_queues, hmq, hmq_link); @@ -224,6 +226,7 @@ htsp_flush_queue(htsp_connection_t *htsp, htsp_msg_q_t *hmq) TAILQ_REMOVE(&hmq->hmq_q, hm, hm_link); htsp_msg_destroy(hm); } + pthread_mutex_unlock(&htsp->htsp_out_mutex); }