From: Andre Noll Date: Mon, 3 Feb 2014 19:45:15 +0000 (+0100) Subject: Don't unlock and lock the thread mutex unnecessarily. X-Git-Tag: v0.5.3~20^2~3 X-Git-Url: http://git.tuebingen.mpg.de/?p=paraslash.git;a=commitdiff_plain;h=bc4fabf9e706f28897ab5c1068a97564f3378750 Don't unlock and lock the thread mutex unnecessarily. --- 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);