From: Mathieu Desnoyers Date: Thu, 23 May 2013 00:46:47 +0000 (-0400) Subject: Fix rcuja: delete last node X-Git-Url: http://git.liburcu.org/?a=commitdiff_plain;h=d810c97fa1a23582360b32a91c2eac45a3bde385;p=userspace-rcu.git Fix rcuja: delete last node Signed-off-by: Mathieu Desnoyers --- diff --git a/rcuja/rcuja.c b/rcuja/rcuja.c index 67964b6..7402cf3 100644 --- a/rcuja/rcuja.c +++ b/rcuja/rcuja.c @@ -1015,7 +1015,7 @@ int ja_attach_node(struct cds_ja *ja, if (node_flag_ptr && ja_node_ptr(*node_flag_ptr) != NULL) { /* - * Attach point is non-NULL: it has been updated between + * Target node is non-NULL: it has been updated between * RCU lookup and lock acquisition. We need to re-try * lookup and attach. */ @@ -1243,7 +1243,7 @@ int ja_detach_node(struct cds_ja *ja, } assert(shadow_node->nr_child > 0); shadow_nodes[nr_shadow++] = shadow_node; - if (shadow_node->nr_child == 1) + if (shadow_node->nr_child == 1 && i > 1) nr_clear++; nr_branch++; if (shadow_node->nr_child > 1 || i == 1) {