From cba031bd54f9bf8daa05c5a28aafc295b9092acf Mon Sep 17 00:00:00 2001 From: Angel Ortega Date: Wed, 26 Jan 2011 10:18:18 +0100 Subject: [PATCH] Added a queue empty test in del_queue_thread(). --- mpdm_v.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/mpdm_v.c b/mpdm_v.c index d99ba31..1ff5d82 100644 --- a/mpdm_v.c +++ b/mpdm_v.c @@ -90,6 +90,10 @@ static mpdm_t del_queue_thread(mpdm_t args, mpdm_t ctxt) /* wait for next value */ mpdm_semaphore_wait(mpdm->del_queue_sem); + /* do nothing if the queue is empty (should't happen) */ + if (mpdm->del == NULL) + continue; + /* atomically dequeue */ mpdm_mutex_lock(mpdm->del_queue_mutex); -- 2.11.4.GIT