From: Howard Chu Date: Sun, 25 Jan 2009 01:53:32 +0000 (+0000) Subject: More for prev commit X-Git-Tag: ACLCHECK_0~964 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=b69b2d2f6927a62930bd51b95d37024940ef5614;p=openldap More for prev commit --- diff --git a/servers/slapd/result.c b/servers/slapd/result.c index 760113b9c7..22cfde8688 100644 --- a/servers/slapd/result.c +++ b/servers/slapd/result.c @@ -160,10 +160,11 @@ static long send_ldap_ber( } conn->c_writers++; - ldap_pvt_thread_mutex_unlock( &conn->c_write1_mutex ); - if ( closing ) + if ( closing ) { + ldap_pvt_thread_mutex_unlock( &conn->c_write1_mutex ); return 0; + } /* write the pdu */ while( 1 ) { @@ -203,20 +204,18 @@ static long send_ldap_ber( conn->c_writewaiter = 1; slapd_set_write( conn->c_sd, 1 ); + ldap_pvt_thread_mutex_unlock( &conn->c_write1_mutex ); ldap_pvt_thread_mutex_unlock( &conn->c_mutex ); ldap_pvt_thread_cond_wait( &conn->c_write2_cv, &conn->c_write2_mutex ); conn->c_writewaiter = 0; ldap_pvt_thread_mutex_unlock( &conn->c_write2_mutex ); ldap_pvt_thread_mutex_lock( &conn->c_write1_mutex ); - closing = ( conn->c_writers < 0 ); - ldap_pvt_thread_mutex_unlock( &conn->c_write1_mutex ); - if ( closing ) { + if ( conn->c_writers < 0 ) { ret = 0; break; } } - ldap_pvt_thread_mutex_lock( &conn->c_write1_mutex ); if ( conn->c_writers < 0 ) { conn->c_writers++; if ( !conn->c_writers )