]> git.sur5r.net Git - openldap/commitdiff
ITS#5484 remove syncop from runq before freeing it
authorHoward Chu <hyc@openldap.org>
Thu, 24 Apr 2008 18:35:35 +0000 (18:35 +0000)
committerHoward Chu <hyc@openldap.org>
Thu, 24 Apr 2008 18:35:35 +0000 (18:35 +0000)
servers/slapd/overlays/syncprov.c

index 9d7a9ad72154672bf4a44414170eb5de9a5fc551..dade31d5aa21e1734a45581757e05aad7dfb5c61 100644 (file)
@@ -737,6 +737,13 @@ syncprov_free_syncop( syncops *so )
                ldap_pvt_thread_mutex_unlock( &so->s_mutex );
                return;
        }
+       if ( so->s_qtask ) {
+               ldap_pvt_thread_mutex_lock( &slapd_rq.rq_mutex );
+               if ( ldap_pvt_runqueue_isrunning( &slapd_rq, so->s_qtask ) )
+                       ldap_pvt_runqueue_stoptask( &slapd_rq, so->s_qtask );
+               ldap_pvt_runqueue_remove( &slapd_rq, so->s_qtask );
+               ldap_pvt_thread_mutex_unlock( &slapd_rq.rq_mutex );
+       }
        ldap_pvt_thread_mutex_unlock( &so->s_mutex );
        if ( so->s_flags & PS_IS_DETACHED ) {
                filter_free( so->s_op->ors_filter );