From 0bf2cae5a6cd35ea7ee78fbb136ccb58f6937b3e Mon Sep 17 00:00:00 2001 From: William Hubbs Date: Thu, 25 Jun 2009 12:06:51 -0500 Subject: [PATCH] moved lock/unlock in queue_process_entry The only time queue_process_entry should lock the queue gard is when it is removing the item from the queue. This happens only when the item was successfully processed. --- synth.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/synth.c b/synth.c index 1bfb0ce..f61d529 100644 --- a/synth.c +++ b/synth.c @@ -179,10 +179,11 @@ static void queue_process_entry(struct synth_t *s) break; } - pthread_mutex_lock(&queue_guard); - if (error == EE_OK) + if (error == EE_OK) { + pthread_mutex_lock(&queue_guard); queue_remove(); - pthread_mutex_unlock(&queue_guard); + pthread_mutex_unlock(&queue_guard); + } } }