From bc4fabf9e706f28897ab5c1068a97564f3378750 Mon Sep 17 00:00:00 2001 From: Andre Noll Date: Mon, 3 Feb 2014 20:45:15 +0100 Subject: [PATCH] Don't unlock and lock the thread mutex unnecessarily. --- ao_write.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ao_write.c b/ao_write.c index d1d62a6d..5c14aa71 100644 --- a/ao_write.c +++ b/ao_write.c @@ -367,10 +367,10 @@ static int aow_post_select(__a_unused struct sched *s, goto remove_thread_btrn; } } - pthread_mutex_unlock(&pawd->mutex); - if (ret >= 0) + if (ret >= 0) { + pthread_mutex_unlock(&pawd->mutex); goto out; - pthread_mutex_lock(&pawd->mutex); + } btr_remove_node(&wn->btrn); pthread_cond_signal(&pawd->data_available); pthread_mutex_unlock(&pawd->mutex); -- 2.30.2