From: Howard Chu Date: Tue, 28 Jun 2005 00:43:41 +0000 (+0000) Subject: ITS#3796 fix IDL cache lock setup/teardown X-Git-Tag: OPENLDAP_AC_BP~498 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=52165180f7713b5fdebef933a9dca8842daa2e2a;p=openldap ITS#3796 fix IDL cache lock setup/teardown --- diff --git a/servers/slapd/back-bdb/init.c b/servers/slapd/back-bdb/init.c index b63961f027..d8fea3b380 100644 --- a/servers/slapd/back-bdb/init.c +++ b/servers/slapd/back-bdb/init.c @@ -69,6 +69,8 @@ bdb_db_init( BackendDB *be ) ldap_pvt_thread_mutex_init( &bdb->bi_cache.lru_mutex ); ldap_pvt_thread_mutex_init( &bdb->bi_cache.c_dntree.bei_kids_mutex ); ldap_pvt_thread_rdwr_init ( &bdb->bi_cache.c_rwlock ); + ldap_pvt_thread_rdwr_init( &bdb->bi_idl_tree_rwlock ); + ldap_pvt_thread_mutex_init( &bdb->bi_idl_tree_lrulock ); be->be_private = bdb; be->be_cf_ocs = be->bd_info->bi_cf_ocs; @@ -385,8 +387,6 @@ bdb_db_open( BackendDB *be ) if ( bdb->bi_idl_cache_max_size ) { bdb->bi_idl_tree = NULL; - ldap_pvt_thread_rdwr_init( &bdb->bi_idl_tree_rwlock ); - ldap_pvt_thread_mutex_init( &bdb->bi_idl_tree_lrulock ); bdb->bi_idl_cache_size = 0; } @@ -630,10 +630,8 @@ bdb_db_destroy( BackendDB *be ) ldap_pvt_thread_mutex_destroy( &bdb->bi_cache.c_dntree.bei_kids_mutex ); ldap_pvt_thread_mutex_destroy( &bdb->bi_lastid_mutex ); ldap_pvt_thread_mutex_destroy( &bdb->bi_database_mutex ); - if ( bdb->bi_idl_cache_max_size ) { - ldap_pvt_thread_rdwr_destroy( &bdb->bi_idl_tree_rwlock ); - ldap_pvt_thread_mutex_destroy( &bdb->bi_idl_tree_lrulock ); - } + ldap_pvt_thread_rdwr_destroy( &bdb->bi_idl_tree_rwlock ); + ldap_pvt_thread_mutex_destroy( &bdb->bi_idl_tree_lrulock ); ch_free( bdb ); be->be_private = NULL;