From: Howard Chu Date: Sun, 25 Jan 2009 03:04:43 +0000 (+0000) Subject: More for prev commit X-Git-Tag: ACLCHECK_0~962 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=ef846c91058c66f70b011f860a07c3b239b80579;p=openldap More for prev commit --- diff --git a/servers/slapd/result.c b/servers/slapd/result.c index 22cfde8688..3ec5021db5 100644 --- a/servers/slapd/result.c +++ b/servers/slapd/result.c @@ -171,7 +171,15 @@ static long send_ldap_ber( int err; /* lock the connection */ - ldap_pvt_thread_mutex_lock( &conn->c_mutex ); + if ( ldap_pvt_thread_mutex_trylock( &conn->c_mutex )) { + ldap_pvt_thread_mutex_unlock( &conn->c_write1_mutex ); + ldap_pvt_thread_mutex_lock( &conn->c_write1_mutex ); + if ( conn->c_writers < 0 ) { + ret = 0; + break; + } + continue; + } if ( ber_flush2( conn->c_sb, ber, LBER_FLUSH_FREE_NEVER ) == 0 ) { ldap_pvt_thread_mutex_unlock( &conn->c_mutex );