-/* Copyright (c) 2003 by International Business Machines, Inc.
+/* $OpenLDAP$ */
+/* This work is part of OpenLDAP Software <http://www.openldap.org/>.
*
- * International Business Machines, Inc. (hereinafter called IBM) grants
- * permission under its copyrights to use, copy, modify, and distribute
-this
- * Software with or without fee, provided that the above copyright notice
-and
- * all paragraphs of this notice appear in all copies, and that the name
-of IBM
- * not be used in connection with the marketing of any product
-incorporating
- * the Software or modifications thereof, without specific, written prior
- * permission.
+ * Copyright 1999-2003 The OpenLDAP Foundation.
+ * Portions Copyright 2003 IBM Corporation.
+ * All rights reserved.
*
- * THE SOFTWARE IS PROVIDED "AS IS", AND IBM DISCLAIMS ALL WARRANTIES,
- * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
- * PARTICULAR PURPOSE. IN NO EVENT SHALL IBM BE LIABLE FOR ANY SPECIAL,
- * DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
-ARISING
- * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE,
-EVEN
- * IF IBM IS APPRISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted only as authorized by the OpenLDAP
+ * Public License.
+ *
+ * A copy of this license is available in the file LICENSE in the
+ * top-level directory of the distribution or, alternatively, at
+ * <http://www.OpenLDAP.org/license.html>.
+ */
+/* ACKNOWLEDGEMENTS:
+ * This work was initially developed by the Apurva Kumar for inclusion
+ * in OpenLDAP Software.
*/
-
#ifndef META_CACHE_H
#define META_CACHE_H
#include "slap.h"
-#ifdef LDAP_CACHING
/* cache specific errors */
-enum type_of_result
-{
+enum type_of_result {
SUCCESS,
CONN_ERR,
RESULT_ERR,
int num_entries_limit; /* max # of entries in a cacheable query */
int threads; /* number of threads currently in meta_back_search */
- int consistency_cycle_time; /* interval between successive consistency checks (sec) */
- int consistency_time; /* time when consistency check was last performed (sec) */
+ int cc_period; /* interval between successive consistency checks (sec) */
+ int cc_thread_started;
+ ldap_pvt_thread_t cc_thread;
ldap_pvt_thread_mutex_t cache_mutex;
ldap_pvt_thread_mutex_t remove_mutex;
- ldap_pvt_thread_mutex_t consistency_mutex;
+ ldap_pvt_thread_mutex_t cc_mutex;
query_manager* qm; /* query cache managed by the cache manager */
} cache_manager;
struct exception* result
);
#endif
-#endif