rcuja: Add missing header
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Mon, 27 May 2013 18:59:01 +0000 (14:59 -0400)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Mon, 27 May 2013 18:59:01 +0000 (14:59 -0400)
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
urcu/rcuja.h [new file with mode: 0644]

diff --git a/urcu/rcuja.h b/urcu/rcuja.h
new file mode 100644 (file)
index 0000000..9a006a3
--- /dev/null
@@ -0,0 +1,84 @@
+#ifndef _URCU_RCUJA_H
+#define _URCU_RCUJA_H
+
+/*
+ * urcu/rcuja.h
+ *
+ * Userspace RCU library - RCU Judy Array
+ *
+ * Copyright 2012 - Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ *
+ * Include this file _after_ including your URCU flavor.
+ */
+
+#include <stdint.h>
+#include <urcu/compiler.h>
+#include <urcu-call-rcu.h>
+#include <urcu-flavor.h>
+#include <stdint.h>
+#include <urcu/rcuhlist.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+struct cds_ja_node {
+       /* Linked list of nodes with same key */
+       struct cds_hlist_node list;
+       /* delayed reclaim */
+       struct rcu_head head;
+};
+
+struct cds_ja;
+
+/*
+ * cds_ja_node_init - initialize a judy array node
+ * @node: the node to initialize.
+ *
+ * This function is kept to be eventually used for debugging purposes
+ * (detection of memory corruption).
+ */
+static inline
+void cds_ja_node_init(struct cds_ja_node *node)
+{
+}
+
+struct cds_hlist_head cds_ja_lookup(struct cds_ja *ja, uint64_t key);
+
+int cds_ja_add(struct cds_ja *ja, uint64_t key,
+               struct cds_ja_node *new_node);
+
+int cds_ja_del(struct cds_ja *ja, uint64_t key,
+               struct cds_ja_node *node);
+
+struct cds_ja *_cds_ja_new(unsigned int key_bits,
+               const struct rcu_flavor_struct *flavor);
+
+static inline
+struct cds_ja *cds_ja_new(unsigned int key_bits)
+{
+       return _cds_ja_new(key_bits, &rcu_flavor);
+}
+
+int cds_ja_destroy(struct cds_ja *ja,
+               void (*free_node_cb)(struct rcu_head *head));
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* _URCU_RCUJA_H */
This page took 0.027056 seconds and 4 git commands to generate.