cds containers: lfqueue and lfstack: don't depend on a particular rcu flavor
[urcu.git] / tests / test_urcu_lfs.c
index 834c72ea1abd22a42980ad0e8f324b1a4fa9c073..71596fdb3071b77123eb64c4069401ae77a96b01 100644 (file)
@@ -177,6 +177,7 @@ void *thr_enqueuer(void *_count)
                if (!node)
                        goto fail;
                cds_lfs_node_init_rcu(node);
+               /* No rcu read-side is needed for push */
                cds_lfs_push_rcu(&s, node);
                nr_successful_enqueues++;
 
@@ -223,13 +224,15 @@ void *thr_dequeuer(void *_count)
        cmm_smp_mb();
 
        for (;;) {
-               struct cds_lfs_node_rcu *node = cds_lfs_pop_rcu(&s);
+               struct cds_lfs_node_rcu *node;
 
+               rcu_read_lock();
+               node = cds_lfs_pop_rcu(&s);
+               rcu_read_unlock();
                if (node) {
                        defer_rcu(free, node);
                        nr_successful_dequeues++;
                }
-
                nr_dequeues++;
                if (unlikely(!test_duration_dequeue()))
                        break;
This page took 0.0228 seconds and 4 git commands to generate.