X-Git-Url: https://git.liburcu.org/?a=blobdiff_plain;f=tests%2Ftest_urcu_lfq.c;h=1bbaf3cfd504a2abd0ead6e724f2b514c079dff5;hb=747b5930591527b65ad737ba609a59106ec2e89b;hp=66ddd410c6d7d80c26bd35bf95e425fbfaf611ae;hpb=bd252a04bbbb163aa4d8864b1e1e5a3a4d9d0892;p=urcu.git diff --git a/tests/test_urcu_lfq.c b/tests/test_urcu_lfq.c index 66ddd41..1bbaf3c 100644 --- a/tests/test_urcu_lfq.c +++ b/tests/test_urcu_lfq.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(); } @@ -243,14 +243,15 @@ void *thr_dequeuer(void *_count) for (;;) { struct cds_lfq_node_rcu *qnode; - struct test *node; rcu_read_lock(); qnode = cds_lfq_dequeue_rcu(&q); - node = caa_container_of(qnode, struct test, list); rcu_read_unlock(); - if (node) { + if (qnode) { + struct test *node; + + node = caa_container_of(qnode, struct test, list); call_rcu(&node->rcu, free_node_cb); URCU_TLS(nr_successful_dequeues)++; }