]> git.sur5r.net Git - openldap/commitdiff
cleanup locking
authorPierangelo Masarati <ando@openldap.org>
Sat, 20 Aug 2005 19:00:56 +0000 (19:00 +0000)
committerPierangelo Masarati <ando@openldap.org>
Sat, 20 Aug 2005 19:00:56 +0000 (19:00 +0000)
servers/slapd/back-ldap/bind.c

index 3765e3bb0a523d41e5c918e981c70716b8b4d1b6..7ce02eda4cb8fee237dd06753dcef948d70fa047 100644 (file)
@@ -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 );