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) {
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)++;
}
}
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);