]> git.sur5r.net Git - openldap/commitdiff
stop and remove checkpoint task in _db_destroy (ITS#5698)
authorRalf Haferkamp <ralf@openldap.org>
Fri, 12 Sep 2008 09:53:40 +0000 (09:53 +0000)
committerRalf Haferkamp <ralf@openldap.org>
Fri, 12 Sep 2008 09:53:40 +0000 (09:53 +0000)
servers/slapd/back-bdb/init.c

index 14bd1b1bfcf14e4c579a02bec4e846a0a59a3b13..393b6a52f42038b677814c6533ec9d866498eb22 100644 (file)
@@ -640,6 +640,17 @@ bdb_db_destroy( BackendDB *be, ConfigReply *cr )
 {
        struct bdb_info *bdb = (struct bdb_info *) be->be_private;
 
+       /* stop and remove checkpoint task */
+       if ( bdb->bi_txn_cp_task ) {
+               struct re_s *re = bdb->bi_txn_cp_task;
+               bdb->bi_txn_cp_task = NULL;
+               ldap_pvt_thread_mutex_lock( &slapd_rq.rq_mutex );
+               if ( ldap_pvt_runqueue_isrunning( &slapd_rq, re ) )
+                       ldap_pvt_runqueue_stoptask( &slapd_rq, re );
+               ldap_pvt_runqueue_remove( &slapd_rq, re );
+               ldap_pvt_thread_mutex_unlock( &slapd_rq.rq_mutex );
+       }
+
        /* monitor handling */
        (void)bdb_monitor_db_destroy( be );