+ /* set cache mutex */
+ ldap_pvt_thread_mutex_lock( &cache->c_mutex );
+
+#ifdef NEW_LOGGING
+ LDAP_LOG( CACHE, ENTRY, "cache_release_all: enter\n" , 0, 0, 0);
+#else
+ Debug( LDAP_DEBUG_TRACE, "====> cache_release_all\n", 0, 0, 0 );
+#endif
+
+
+ while ( (e = cache->c_lrutail) != NULL && LEI(e)->lei_refcnt == 0 ) {
+ /* delete from cache and lru q */
+ /* XXX do we need rc ? */
+ rc = cache_delete_entry_internal( cache, e );
+ cache_entry_private_destroy( e );
+ entry_free( e );
+ }
+
+ if ( cache->c_cursize ) {
+#ifdef NEW_LOGGING
+ LDAP_LOG( CACHE, INFO,
+ "cache_release_all: Entry cache could not be emptied.\n", 0, 0, 0);
+#else
+ Debug( LDAP_DEBUG_TRACE, "Entry-cache could not be emptied\n", 0, 0, 0 );
+#endif
+ }
+
+ /* free cache mutex */
+ ldap_pvt_thread_mutex_unlock( &cache->c_mutex );
+}
+
+#ifdef LDAP_DEBUG