]> git.sur5r.net Git - openldap/commitdiff
stop pcache task at close
authorPierangelo Masarati <ando@openldap.org>
Mon, 13 Aug 2007 16:28:33 +0000 (16:28 +0000)
committerPierangelo Masarati <ando@openldap.org>
Mon, 13 Aug 2007 16:28:33 +0000 (16:28 +0000)
servers/slapd/overlays/pcache.c

index 8c6564707acd692707e4e62249c0c83a2cb479e8..8361956088ff96feebf6a215b4dd1a062d8df344 100644 (file)
@@ -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 );
        }