X-Git-Url: http://git.liburcu.org/?p=urcu.git;a=blobdiff_plain;f=include%2Furcu%2Fstatic%2Frculfstack.h;fp=include%2Furcu%2Fstatic%2Frculfstack.h;h=b44b9e29fdbad9b73024d653fb992218f221644b;hp=5bb06b1a366142e1552ea6be01e691a07009862f;hb=0e2125fb7b2c7a92d7030b41df5fb372a7706c32;hpb=601922a81d884e16ff404cee7534ede56fb87d0a diff --git a/include/urcu/static/rculfstack.h b/include/urcu/static/rculfstack.h index 5bb06b1..b44b9e2 100644 --- a/include/urcu/static/rculfstack.h +++ b/include/urcu/static/rculfstack.h @@ -69,7 +69,9 @@ int _cds_lfs_push_rcu(struct cds_lfs_stack_rcu *s, * uatomic_cmpxchg() implicit memory barrier orders earlier * stores to node before publication. */ - head = uatomic_cmpxchg(&s->head, old_head, node); + cmm_emit_legacy_smp_mb(); + head = uatomic_cmpxchg_mo(&s->head, old_head, node, + CMM_SEQ_CST, CMM_SEQ_CST); if (old_head == head) break; } @@ -94,7 +96,9 @@ _cds_lfs_pop_rcu(struct cds_lfs_stack_rcu *s) if (head) { struct cds_lfs_node_rcu *next = rcu_dereference(head->next); - if (uatomic_cmpxchg(&s->head, head, next) == head) { + if (uatomic_cmpxchg_mo(&s->head, head, next, + CMM_SEQ_CST, CMM_SEQ_CST) == head) { + cmm_emit_legacy_smp_mb(); return head; } else { /* Concurrent modification. Retry. */