mirror of
https://git.openldap.org/openldap/openldap.git
synced 2025-01-12 10:54:48 +08:00
cleanup locking
This commit is contained in:
parent
09e167427a
commit
15d1b4d5dd
@ -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 );
|
||||
|
Loading…
Reference in New Issue
Block a user