- if (!replace_pinned) {
- if (_cds_lfht_del(ht, size, clear_flag(iter), 0, 0))
- continue; /* concurrently removed. retry. */
- }
- /*
- * After _cds_lfht_del succeeds, we have pinned the
- * to-be-removed node in place by setting its removed
- * flag, but not its gc flag. If we fail to cmpxchg our
- * new node with this node, we need to retry everything
- * from the initial lookup, and only stop when we reach
- * the node we pinned into place.
- */
- return_node = uatomic_cmpxchg(&iter_prev->p.next,
- iter, new_node);
- if (return_node != iter) {
- /*
- * If cmpxchg fails, we need to do path
- * compression, but end it by placing our own
- * node into place.
- */
- replace_pinned = clear_flag(iter);
+ new_node = flag_removed(new_node);
+ if (uatomic_cmpxchg(&iter_prev->p.next,
+ iter, new_node) != iter) {