Support the add operation of urcu hash table
authorDavid Goulet <dgoulet@efficios.com>
Tue, 16 Oct 2012 19:06:12 +0000 (15:06 -0400)
committerDavid Goulet <dgoulet@efficios.com>
Fri, 19 Oct 2012 17:11:55 +0000 (13:11 -0400)
This add operation supports redundant keys in the table.

Signed-off-by: David Goulet <dgoulet@efficios.com>
src/common/hashtable/hashtable.c
src/common/hashtable/hashtable.h

index ac39004e64617eceb6f1ba7d2b5b479021e50237..46717c9bab15fb82aee3d355a68f6e43d4496c91 100644 (file)
@@ -183,6 +183,19 @@ void lttng_ht_add_unique_str(struct lttng_ht *ht,
        assert(node_ptr == &node->node);
 }
 
+/*
+ * Add unsigned long node to hashtable.
+ */
+void lttng_ht_add_ulong(struct lttng_ht *ht, struct lttng_ht_node_ulong *node)
+{
+       assert(ht);
+       assert(ht->ht);
+       assert(node);
+
+       cds_lfht_add(ht->ht, ht->hash_fct((void *) node->key, HASH_SEED),
+                       &node->node);
+}
+
 /*
  * Add unique unsigned long node to hashtable.
  */
index f242e75e895c78ab22769468efca4aa3c074be95..90b4412756cb9f6f0d93e25b752e232bb69399ee 100644 (file)
@@ -74,6 +74,8 @@ extern void lttng_ht_add_unique_ulong(struct lttng_ht *ht,
                struct lttng_ht_node_ulong *node);
 extern struct lttng_ht_node_ulong *lttng_ht_add_replace_ulong(
                struct lttng_ht *ht, struct lttng_ht_node_ulong *node);
+extern void lttng_ht_add_ulong(struct lttng_ht *ht,
+               struct lttng_ht_node_ulong *node);
 
 extern int lttng_ht_del(struct lttng_ht *ht, struct lttng_ht_iter *iter);
 
This page took 0.028106 seconds and 5 git commands to generate.