X-Git-Url: https://git.liburcu.org/?a=blobdiff_plain;f=tests%2Ftest_urcu_lfs.c;h=71596fdb3071b77123eb64c4069401ae77a96b01;hb=d9b52143813e104eeee1e3d90061042230b7b5bf;hp=a1d6a1f063946a51ec27348dbdfc6748494d679f;hpb=6ade67d5cb23ae9e2c18e7c2a62e3202552fb9e2;p=urcu.git diff --git a/tests/test_urcu_lfs.c b/tests/test_urcu_lfs.c index a1d6a1f..71596fd 100644 --- a/tests/test_urcu_lfs.c +++ b/tests/test_urcu_lfs.c @@ -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++; @@ -203,6 +204,7 @@ fail: void *thr_dequeuer(void *_count) { unsigned long long *count = _count; + int ret; printf_verbose("thread_begin %s, thread id : %lx, tid %lu\n", "dequeuer", pthread_self(), (unsigned long)gettid()); @@ -222,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;