From 85f6ba5f7a5b91ecb4a7a8a6d66cd17ff481de21 Mon Sep 17 00:00:00 2001 From: Mathieu Desnoyers Date: Wed, 30 Sep 2009 10:08:29 -0400 Subject: [PATCH] urcu-ht: fix steal stolen flag, only in first pass. Signed-off-by: Mathieu Desnoyers --- urcu-ht.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/urcu-ht.c b/urcu-ht.c index 500b8d3..183fcb1 100644 --- a/urcu-ht.c +++ b/urcu-ht.c @@ -174,9 +174,14 @@ retry: node = rcu_dereference(*prev); } - /* Another concurrent thread stole it ? If so, let it deal with this. */ - if (cmpxchg(&node->stolen, 0, 1) != 0) - goto error; + if (!del_node) { + /* + * Another concurrent thread stole it ? If so, let it deal with + * this. + */ + if (cmpxchg(&node->stolen, 0, 1) != 0) + goto error; + } /* Found it ! pointer to object is in "prev" */ if (rcu_cmpxchg_pointer(prev, node, node->next) == node) -- 2.34.1