From: Howard Chu Date: Fri, 8 Sep 2006 23:31:53 +0000 (+0000) Subject: ITS#4667 in connection_closing, release c_mutex to allow waiters X-Git-Tag: OPENLDAP_REL_ENG_2_3_MP~183 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=f82ee25ec1e9f96edb5b3c69675d0cb63dbf6a57;p=openldap ITS#4667 in connection_closing, release c_mutex to allow waiters to clear out. --- diff --git a/servers/slapd/connection.c b/servers/slapd/connection.c index f989d8ddaa..248b3b67f6 100644 --- a/servers/slapd/connection.c +++ b/servers/slapd/connection.c @@ -829,9 +829,15 @@ void connection_closing( Connection *c, const char *why ) connection_abandon( c ); /* wake write blocked operations */ - slapd_clr_write( sd, 1 ); if ( c->c_writewaiter ) { ldap_pvt_thread_cond_signal( &c->c_write_cv ); + ldap_pvt_thread_mutex_unlock( &c->c_mutex ); + slapd_clr_write( sd, 1 ); + ldap_pvt_thread_mutex_lock( &c->c_write_mutex ); + ldap_pvt_thread_mutex_lock( &c->c_mutex ); + ldap_pvt_thread_mutex_unlock( &c->c_write_mutex ); + } else { + slapd_clr_write( sd, 1 ); } } else if( why == NULL && c->c_close_reason == conn_lost_str ) {