From: Mathieu Desnoyers Date: Wed, 30 Sep 2009 14:08:29 +0000 (-0400) Subject: urcu-ht: fix steal stolen flag, only in first pass. X-Git-Tag: v0.7.0~43^2~239^2~1 X-Git-Url: https://git.liburcu.org/?p=urcu.git;a=commitdiff_plain;h=85f6ba5f7a5b91ecb4a7a8a6d66cd17ff481de21 urcu-ht: fix steal stolen flag, only in first pass. Signed-off-by: Mathieu Desnoyers --- 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)