]> git.sur5r.net Git - openldap/commitdiff
ITS#4667 in connection_closing, release c_mutex to allow waiters
authorHoward Chu <hyc@openldap.org>
Fri, 8 Sep 2006 23:31:53 +0000 (23:31 +0000)
committerHoward Chu <hyc@openldap.org>
Fri, 8 Sep 2006 23:31:53 +0000 (23:31 +0000)
to clear out.

servers/slapd/connection.c

index f989d8ddaac734b09dccc83b63631f37553d3428..248b3b67f6a25d4ca6d9f0aa174a71e392cd2b3b 100644 (file)
@@ -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 ) {