From e2fcb2d325f216c558beca525ac25e4e42115dbb Mon Sep 17 00:00:00 2001 From: Mathieu Desnoyers Date: Fri, 21 Jun 2013 12:48:18 -0400 Subject: [PATCH] rculist: implement cds_list_add_tail_rcu Signed-off-by: Mathieu Desnoyers --- urcu/rculist.h | 11 +++++++++++ 1 file changed, 11 insertions(+) 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 -- 2.34.1