From 72b972e808df0f54eb12da82b4b3941e3964ae1d Mon Sep 17 00:00:00 2001 From: Mathieu Desnoyers Date: Sun, 4 Sep 2011 20:04:35 -0400 Subject: [PATCH] test_lfq_baseline: update Signed-off-by: Mathieu Desnoyers --- tests/test_lfq_baseline.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/tests/test_lfq_baseline.c b/tests/test_lfq_baseline.c index aaa1689..4f0eba2 100644 --- a/tests/test_lfq_baseline.c +++ b/tests/test_lfq_baseline.c @@ -243,7 +243,8 @@ void *thr_dequeuer(void *_count) test_mutex_lock(); node = cds_list_first_entry(&q, struct test, node); - cds_list_del(&node->node); + if (node) + cds_list_del(&node->node); test_mutex_unlock(); if (node) { @@ -273,8 +274,8 @@ void test_end(unsigned long long *nr_dequeues) do { node = cds_list_first_entry(&q, struct test, node); - cds_list_del(&node->node); if (node) { + cds_list_del(&node->node); free(node); /* no more concurrent access */ (*nr_dequeues)++; } @@ -416,8 +417,6 @@ int main(int argc, char **argv) } test_end(&end_dequeues); - err = cds_lfq_destroy_rcu(&q); - assert(!err); printf_verbose("total number of enqueues : %llu, dequeues %llu\n", tot_enqueues, tot_dequeues); -- 2.34.1