X-Git-Url: https://git.liburcu.org/?p=urcu.git;a=blobdiff_plain;f=urcu%2Frculist.h;h=1fd2df388f57cefc0ea19fa02a0c8c0b627847e8;hp=a177f20dbf67edab2e666051b7682700def6d7db;hb=b0a841b4ff807dd29fe0cdbfe24900312f0e627b;hpb=e6decba5437e56b138c5f42f7560533b9244bb7b diff --git a/urcu/rculist.h b/urcu/rculist.h index a177f20..1fd2df3 100644 --- a/urcu/rculist.h +++ b/urcu/rculist.h @@ -35,9 +35,19 @@ void cds_list_add_rcu(struct cds_list_head *newp, struct cds_list_head *head) { newp->next = head->next; 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. */ +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; } /* @@ -59,7 +69,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); } /*