]> git.sur5r.net Git - openldap/commitdiff
ITS#3671 must release conn->c_mutex to allow blocked writers to exit
authorHoward Chu <hyc@openldap.org>
Thu, 28 Apr 2005 18:36:08 +0000 (18:36 +0000)
committerHoward Chu <hyc@openldap.org>
Thu, 28 Apr 2005 18:36:08 +0000 (18:36 +0000)
servers/slapd/connection.c

index 2441e6a7c9a639bce7ccd2bd88653ab9f52c5ba6..2f9ab790610e39ae41a45572783d1e1dfb773728 100644 (file)
@@ -767,7 +767,12 @@ void connection_closing( Connection *c )
 
                /* wake write blocked operations */
                slapd_clr_write( sd, 1 );
-               ldap_pvt_thread_cond_signal( &c->c_write_cv );
+               if ( c->c_writewaiter ) {
+                       ldap_pvt_thread_cond_signal( &c->c_write_cv );
+                       ldap_pvt_thread_mutex_unlock( &c->c_mutex );
+                       ldap_pvt_thread_yield();
+                       ldap_pvt_thread_mutex_lock( &c->c_mutex );
+               }
        }
 }