rculist: implement cds_list_add_tail_rcu
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Fri, 21 Jun 2013 16:48:18 +0000 (12:48 -0400)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Fri, 21 Jun 2013 17:46:50 +0000 (13:46 -0400)
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
urcu/rculist.h

index a177f20dbf67edab2e666051b7682700def6d7db..ab88226b5f73d9ffff856ff347aefb3757c6a53f 100644 (file)
@@ -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
This page took 0.036061 seconds and 4 git commands to generate.