From: Howard Chu Date: Thu, 15 Jan 2009 21:22:35 +0000 (+0000) Subject: Fix prev commit, c_writers check should be mutex'd X-Git-Tag: ACLCHECK_0~1008 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=dd15627a5e2e2130f163eb5fc50f2c4214639f95;p=openldap Fix prev commit, c_writers check should be mutex'd --- diff --git a/servers/slapd/connection.c b/servers/slapd/connection.c index f20a0552b4..3169e1018e 100644 --- a/servers/slapd/connection.c +++ b/servers/slapd/connection.c @@ -761,8 +761,8 @@ void connection_closing( Connection *c, const char *why ) connection_abandon( c ); /* wake write blocked operations */ + ldap_pvt_thread_mutex_lock( &c->c_write1_mutex ); if ( c->c_writers > 0 ) { - ldap_pvt_thread_mutex_lock( &c->c_write1_mutex ); c->c_writers = -c->c_writers; ldap_pvt_thread_cond_broadcast( &c->c_write1_cv ); ldap_pvt_thread_mutex_unlock( &c->c_write1_mutex ); @@ -778,6 +778,7 @@ void connection_closing( Connection *c, const char *why ) } ldap_pvt_thread_mutex_unlock( &c->c_write1_mutex ); } else { + ldap_pvt_thread_mutex_unlock( &c->c_write1_mutex ); slapd_clr_write( c->c_sd, 1 ); }