From: Mathieu Desnoyers Date: Wed, 5 Jun 2013 19:24:00 +0000 (-0400) Subject: rculist: identify stores to shared pointers X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=4b677847e8454cc75399bef6d380eb9df38ee3f9;p=urcu.git rculist: identify stores to shared pointers Signed-off-by: Mathieu Desnoyers --- diff --git a/urcu/rculist.h b/urcu/rculist.h index 3604a96..e67503d 100644 --- a/urcu/rculist.h +++ b/urcu/rculist.h @@ -33,11 +33,12 @@ */ static inline void cds_list_add_rcu(struct cds_list_head *newp, struct cds_list_head *head) { - newp->next = head->next; + struct cds_list_head *first = head->next; + + newp->next = first; newp->prev = head; - cmm_smp_wmb(); - head->next->prev = newp; - head->next = newp; + rcu_assign_pointer(head->next, newp); + first->prev = newp; } /* replace an old entry atomically. @@ -54,7 +55,7 @@ static inline void cds_list_replace_rcu(struct cds_list_head *old, struct cds_li static inline void cds_list_del_rcu(struct cds_list_head *elem) { elem->next->prev = elem->prev; - elem->prev->next = elem->next; + CMM_STORE_SHARED(elem->prev->next, elem->next); } /*