X-Git-Url: http://git.liburcu.org/?a=blobdiff_plain;f=urcu%2Frculist.h;h=6759947dba2b78bcdb41b16222afd490922722f9;hb=refs%2Fheads%2Furcu%2Frcuja-range;hp=ab88226b5f73d9ffff856ff347aefb3757c6a53f;hpb=e2fcb2d325f216c558beca525ac25e4e42115dbb;p=userspace-rcu.git diff --git a/urcu/rculist.h b/urcu/rculist.h index ab88226..6759947 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); } /* Add new element at the tail of the list. */ @@ -70,7 +71,7 @@ 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); } /*