X-Git-Url: https://git.liburcu.org/?a=blobdiff_plain;f=urcu%2Fstatic%2Frculfqueue.h;h=6045c184d22b2b9af8ea0c03bb33a1f026d24be0;hb=707c65a80f4bc33d6eb335f1128453dc60658232;hp=0970c0f3f0cf2fdfd1a1f31c936bac059d712804;hpb=909292c2c03dd468a7d0d4679e227a08170f51a7;p=urcu.git diff --git a/urcu/static/rculfqueue.h b/urcu/static/rculfqueue.h index 0970c0f..6045c18 100644 --- a/urcu/static/rculfqueue.h +++ b/urcu/static/rculfqueue.h @@ -62,7 +62,7 @@ struct cds_lfq_node_rcu_dummy { static inline int is_dummy(struct cds_lfq_queue_rcu *q, struct cds_lfq_node_rcu *node) { - return node == q->dummy; + return node == CMM_LOAD_SHARED(q->dummy); } static inline @@ -203,9 +203,13 @@ struct cds_lfq_node_rcu *_cds_lfq_dequeue_rcu(struct cds_lfq_queue_rcu *q) /* * We are the only thread * allowed to update dummy (we - * own the old dummy). + * own the old dummy). Other + * dequeue threads read it + * concurrently with RCU + * read-lock held, which + * protects from ABA. */ - q->dummy = node; + CMM_STORE_SHARED(q->dummy, node); _cds_lfq_enqueue_rcu(q, node); continue; /* try again */ }