X-Git-Url: http://git.liburcu.org/?a=blobdiff_plain;f=tests%2Ftest_urcu_lfs.c;h=61abaad4567cf2c79a080d98e5eec99947f2162b;hb=747b5930591527b65ad737ba609a59106ec2e89b;hp=5886ce86de50c1ab2c25c61a172d895fa4a33a53;hpb=ab0aacbe1a25d50d069f0b24aa492e84ea296f57;p=urcu.git diff --git a/tests/test_urcu_lfs.c b/tests/test_urcu_lfs.c index 5886ce8..61abaad 100644 --- a/tests/test_urcu_lfs.c +++ b/tests/test_urcu_lfs.c @@ -67,7 +67,6 @@ static inline pid_t gettid(void) #endif #include #include -#include static volatile int test_go, test_stop; @@ -221,18 +220,12 @@ void free_node_cb(struct rcu_head *head) 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()); set_affinity(); - ret = rcu_defer_register_thread(); - if (ret) { - printf("Error in rcu_defer_register_thread\n"); - exit(-1); - } rcu_register_thread(); while (!test_go) @@ -242,13 +235,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)++; } @@ -260,7 +254,6 @@ void *thr_dequeuer(void *_count) } rcu_unregister_thread(); - rcu_defer_unregister_thread(); printf_verbose("dequeuer thread_end, thread id : %lx, tid %lu, " "dequeues %llu, successful_dequeues %llu\n",