X-Git-Url: http://git.liburcu.org/?a=blobdiff_plain;f=tests%2Ftest_urcu_lfs.c;h=99d1b4c9dfb426179b81e6c371623541f018c445;hb=f3eb6ef162778c396fcffefda3f3379fce5cab17;hp=88bf65d09bd533bf19139a4028e68e990e43ea64;hpb=bd252a04bbbb163aa4d8864b1e1e5a3a4d9d0892;p=urcu.git diff --git a/tests/test_urcu_lfs.c b/tests/test_urcu_lfs.c index 88bf65d..99d1b4c 100644 --- a/tests/test_urcu_lfs.c +++ b/tests/test_urcu_lfs.c @@ -78,9 +78,9 @@ static unsigned long duration; /* read-side C.S. duration, in loops */ static unsigned long wdelay; -static inline void loop_sleep(unsigned long l) +static inline void loop_sleep(unsigned long loops) { - while(l-- != 0) + while (loops-- != 0) caa_cpu_relax(); } @@ -242,13 +242,14 @@ void *thr_dequeuer(void *_count) for (;;) { struct cds_lfs_node_rcu *snode; - struct test *node; rcu_read_lock(); snode = cds_lfs_pop_rcu(&s); - node = caa_container_of(snode, struct test, list); rcu_read_unlock(); - if (node) { + if (snode) { + struct test *node; + + node = caa_container_of(snode, struct test, list); call_rcu(&node->rcu, free_node_cb); URCU_TLS(nr_successful_dequeues)++; }