mirror of
https://git.openldap.org/openldap/openldap.git
synced 2025-12-31 12:09:35 -05:00
More for prev commit
This commit is contained in:
parent
aedaaf6658
commit
b69b2d2f69
1 changed files with 5 additions and 6 deletions
|
|
@ -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 )
|
||||
|
|
|
|||
Loading…
Reference in a new issue