From c2ceb27c04ba6857acf9532d787b92c28566f69e Mon Sep 17 00:00:00 2001 From: Mathieu Desnoyers Date: Sun, 4 Sep 2011 17:57:59 -0400 Subject: [PATCH] urcu-rbtree: add test without rcu define Signed-off-by: Mathieu Desnoyers --- urcu-rbtree.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/urcu-rbtree.c b/urcu-rbtree.c index 01733f0..4af4ab8 100644 --- a/urcu-rbtree.c +++ b/urcu-rbtree.c @@ -159,6 +159,7 @@ #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; } -- 2.34.1