From: Ralf Haferkamp Date: Fri, 12 Sep 2008 09:53:40 +0000 (+0000) Subject: stop and remove checkpoint task in _db_destroy (ITS#5698) X-Git-Tag: ACLCHECK_0~1357 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=7bec8b6b8bd8044ae3de5e0ea26841ea4696b0d0;p=openldap stop and remove checkpoint task in _db_destroy (ITS#5698) --- diff --git a/servers/slapd/back-bdb/init.c b/servers/slapd/back-bdb/init.c index 14bd1b1bfc..393b6a52f4 100644 --- a/servers/slapd/back-bdb/init.c +++ b/servers/slapd/back-bdb/init.c @@ -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 );