test_lfq_baseline: update
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Mon, 5 Sep 2011 00:04:35 +0000 (20:04 -0400)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Mon, 5 Sep 2011 00:04:35 +0000 (20:04 -0400)
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
tests/test_lfq_baseline.c

index aaa1689c92fb23c62cbaf6400ced0bb0639644d0..4f0eba21a8651a1ba0bd92a4c76b620373c8a2f6 100644 (file)
@@ -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);
This page took 0.027157 seconds and 4 git commands to generate.