rculist: identify stores to shared pointers
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Wed, 5 Jun 2013 19:24:00 +0000 (15:24 -0400)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Wed, 5 Jun 2013 19:24:00 +0000 (15:24 -0400)
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
urcu/rculist.h

index 3604a96d0619d082ef7c3c2d46a4cff421c04c2e..e67503d9431d5da5d68d8f0a888613b1cebe2395 100644 (file)
  */
 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);
 }
 
 /*
This page took 0.027289 seconds and 4 git commands to generate.