From: Pierangelo Masarati Date: Mon, 13 Aug 2007 16:28:33 +0000 (+0000) Subject: stop pcache task at close X-Git-Tag: OPENLDAP_REL_ENG_2_4_MP~226 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=ccff813df072e1554c998d6dd27efe673fcc7dc4;p=openldap stop pcache task at close --- diff --git a/servers/slapd/overlays/pcache.c b/servers/slapd/overlays/pcache.c index 8c6564707a..8361956088 100644 --- a/servers/slapd/overlays/pcache.c +++ b/servers/slapd/overlays/pcache.c @@ -2809,6 +2809,16 @@ pcache_db_close( cm->db.be_limits = NULL; cm->db.be_acl = NULL; + /* stop the thread ... */ + if ( cm->cc_arg ) { + ldap_pvt_thread_mutex_lock( &slapd_rq.rq_mutex ); + if ( ldap_pvt_runqueue_isrunning( &slapd_rq, cm->cc_arg ) ) { + ldap_pvt_runqueue_stoptask( &slapd_rq, cm->cc_arg ); + } + ldap_pvt_runqueue_remove( &slapd_rq, cm->cc_arg ); + ldap_pvt_thread_mutex_unlock( &slapd_rq.rq_mutex ); + } + if ( cm->db.bd_info->bi_db_close ) { rc = cm->db.bd_info->bi_db_close( &cm->db, NULL ); }