X-Git-Url: http://git.liburcu.org/?a=blobdiff_plain;f=tests%2Fbenchmark%2Ftest_urcu_wfq.c;h=e8474b89ef21b7c163147507064bbc49430a9fb5;hb=70469b43316ecc8d6053550504858ad8a8ef9b16;hp=79ff716c34f153ae66b9e1fe0cd5bc9fa6b35ad7;hpb=0614a2e61ccbf150cc51d4fd3073b285983417c5;p=urcu.git diff --git a/tests/benchmark/test_urcu_wfq.c b/tests/benchmark/test_urcu_wfq.c index 79ff716..e8474b8 100644 --- a/tests/benchmark/test_urcu_wfq.c +++ b/tests/benchmark/test_urcu_wfq.c @@ -133,6 +133,7 @@ static unsigned int nr_dequeuers; static struct cds_wfq_queue q; +static void *thr_enqueuer(void *_count) { unsigned long long *count = _count; @@ -174,6 +175,7 @@ fail: } +static void *thr_dequeuer(void *_count) { unsigned long long *count = _count; @@ -213,20 +215,22 @@ void *thr_dequeuer(void *_count) return ((void*)2); } -void test_end(struct cds_wfq_queue *q, unsigned long long *nr_dequeues) +static +void test_end(unsigned long long *nr_dequeues_l) { struct cds_wfq_node *node; do { - node = cds_wfq_dequeue_blocking(q); + node = cds_wfq_dequeue_blocking(&q); if (node) { free(node); - (*nr_dequeues)++; + (*nr_dequeues_l)++; } } while (node); } -void show_usage(int argc, char **argv) +static +void show_usage(char **argv) { printf("Usage : %s nr_dequeuers nr_enqueuers duration (s) \n", argv[0]); @@ -252,25 +256,25 @@ int main(int argc, char **argv) unsigned int i_thr; if (argc < 4) { - show_usage(argc, argv); + show_usage(argv); return -1; } err = sscanf(argv[1], "%u", &nr_dequeuers); if (err != 1) { - show_usage(argc, argv); + show_usage(argv); return -1; } err = sscanf(argv[2], "%u", &nr_enqueuers); if (err != 1) { - show_usage(argc, argv); + show_usage(argv); return -1; } err = sscanf(argv[3], "%lu", &duration); if (err != 1) { - show_usage(argc, argv); + show_usage(argv); return -1; } @@ -280,7 +284,7 @@ int main(int argc, char **argv) switch (argv[i][1]) { case 'a': if (argc < i + 2) { - show_usage(argc, argv); + show_usage(argv); return -1; } a = atoi(argv[++i]); @@ -290,14 +294,14 @@ int main(int argc, char **argv) break; case 'c': if (argc < i + 2) { - show_usage(argc, argv); + show_usage(argv); return -1; } rduration = atol(argv[++i]); break; case 'd': if (argc < i + 2) { - show_usage(argc, argv); + show_usage(argv); return -1; } wdelay = atol(argv[++i]); @@ -366,7 +370,7 @@ int main(int argc, char **argv) tot_successful_dequeues += count_dequeuer[2 * i_thr + 1]; } - test_end(&q, &end_dequeues); + test_end(&end_dequeues); printf_verbose("total number of enqueues : %llu, dequeues %llu\n", tot_enqueues, tot_dequeues);