urcu-rbtree: add test without rcu define
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Sun, 4 Sep 2011 21:57:59 +0000 (17:57 -0400)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Sun, 4 Sep 2011 21:57:59 +0000 (17:57 -0400)
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
urcu-rbtree.c

index 01733f02df2bd9d9ef9b748dfd1e81046630b6f7..4af4ab8a33e5bff1c06650d6b2012a60830b5f3f 100644 (file)
 #define RBTREE_RCU_SUPPORT_ROTATE_LEFT
 #define RBTREE_RCU_SUPPORT_ROTATE_RIGHT
 #define RBTREE_RCU_SUPPORT_TRANSPLANT
+#define RBTREE_RCU_SUPPORT
 
 #ifdef EXTRA_DEBUG
 static pthread_mutex_t test_mutex = PTHREAD_MUTEX_INITIALIZER;
@@ -255,6 +256,8 @@ void _rcu_rbtree_free_node(struct rcu_head *head)
        node->rbtree->rbfree(node);
 }
 
+#ifdef RBTREE_RCU_SUPPORT
+
 static
 struct rcu_rbtree_node *dup_decay_node(struct rcu_rbtree *rbtree,
                                struct rcu_rbtree_node *x)
@@ -272,6 +275,17 @@ struct rcu_rbtree_node *dup_decay_node(struct rcu_rbtree *rbtree,
        return xc;
 }
 
+#else /* RBTREE_RCU_SUPPORT */
+
+static
+struct rcu_rbtree_node *dup_decay_node(struct rcu_rbtree *rbtree,
+                               struct rcu_rbtree_node *x)
+{
+       return x;
+}
+
+#endif
+
 /*
  * Info for range lookups:
  * Range lookup information is only valid when used when searching for
@@ -1282,7 +1296,11 @@ int rcu_rbtree_remove(struct rcu_rbtree *rbtree,
         * Commit all _CMM_STORE_SHARED().
         */
        cmm_smp_wmc();
+#ifdef RBTREE_RCU_SUPPORT
        rbtree->call_rcu(&z->head, _rcu_rbtree_free_node);
+#else
+       _rcu_rbtree_free_node(&z->head);
+#endif
 
        return 0;
 }
This page took 0.026166 seconds and 4 git commands to generate.