rculfqueue: Document dummy pointer value access
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Fri, 1 Jul 2011 21:42:48 +0000 (17:42 -0400)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Fri, 1 Jul 2011 21:42:48 +0000 (17:42 -0400)
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
urcu/static/rculfqueue.h

index 0970c0f3f0cf2fdfd1a1f31c936bac059d712804..6045c184d22b2b9af8ea0c03bb33a1f026d24be0 100644 (file)
@@ -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 */
                                }
This page took 0.025487 seconds and 4 git commands to generate.