From: Pierangelo Masarati Date: Sat, 20 Aug 2005 19:00:56 +0000 (+0000) Subject: cleanup locking X-Git-Tag: OPENLDAP_REL_ENG_2_2_MP~638 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=15d1b4d5ddedaad0f4cdf491785f579c136c2d78;p=openldap cleanup locking --- diff --git a/servers/slapd/back-ldap/bind.c b/servers/slapd/back-ldap/bind.c index 3765e3bb0a..7ce02eda4c 100644 --- a/servers/slapd/back-ldap/bind.c +++ b/servers/slapd/back-ldap/bind.c @@ -105,19 +105,11 @@ done:; /* wait for all other ops to release the connection */ retry_lock:; - switch ( ldap_pvt_thread_mutex_trylock( &li->conn_mutex ) ) { - case LDAP_PVT_THREAD_EBUSY: - default: + ldap_pvt_thread_mutex_lock( &li->conn_mutex ); + if ( lc->lc_refcnt > 1 ) { + ldap_pvt_thread_mutex_unlock( &li->conn_mutex ); ldap_pvt_thread_yield(); goto retry_lock; - - case 0: - if ( lc->lc_refcnt > 1 ) { - ldap_pvt_thread_mutex_unlock( &li->conn_mutex ); - ldap_pvt_thread_yield(); - goto retry_lock; - } - break; } assert( lc->lc_refcnt == 1 );