From: Mathieu Desnoyers Date: Fri, 21 Jun 2013 16:48:18 +0000 (-0400) Subject: rculist: implement cds_list_add_tail_rcu X-Git-Tag: v0.8.0~60 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=e2fcb2d325f216c558beca525ac25e4e42115dbb;p=urcu.git rculist: implement cds_list_add_tail_rcu Signed-off-by: Mathieu Desnoyers --- diff --git a/urcu/rculist.h b/urcu/rculist.h index a177f20..ab88226 100644 --- a/urcu/rculist.h +++ b/urcu/rculist.h @@ -40,6 +40,17 @@ void cds_list_add_rcu(struct cds_list_head *newp, struct cds_list_head *head) head->next = newp; } +/* Add new element at the tail of the list. */ +static inline +void cds_list_add_tail_rcu(struct cds_list_head *newp, + struct cds_list_head *head) +{ + newp->next = head; + newp->prev = head->prev; + rcu_assign_pointer(head->prev->next, newp); + head->prev = newp; +} + /* * Replace an old entry atomically with respect to concurrent RCU * traversal. Mutual exclusion against concurrent updates is required