X-Git-Url: https://git.liburcu.org/?a=blobdiff_plain;f=tests%2Ftest_urcu_qsbr.c;h=1bade60fd53dddc01a2c963c413254673074abbb;hb=8bad63a0394e7f76f344e065cc90327c099eae8e;hp=065557a1307d8f3cfe22a6c8ea6b6a39a0b3603e;hpb=2953b501ab1dcf908d07de9b414a08397519f5b6;p=urcu.git diff --git a/tests/test_urcu_qsbr.c b/tests/test_urcu_qsbr.c index 065557a..1bade60 100644 --- a/tests/test_urcu_qsbr.c +++ b/tests/test_urcu_qsbr.c @@ -187,6 +187,11 @@ void *thr_reader(void *_count) rcu_register_thread(); + assert(rcu_read_ongoing()); + rcu_thread_offline(); + assert(!rcu_read_ongoing()); + rcu_thread_online(); + while (!test_go) { } @@ -194,6 +199,7 @@ void *thr_reader(void *_count) for (;;) { rcu_read_lock(); + assert(rcu_read_ongoing()); local_ptr = rcu_dereference(test_rcu_pointer); rcu_debug_yield_read(); if (local_ptr) @@ -266,15 +272,17 @@ void *thr_writer(void *_count) void show_usage(int argc, char **argv) { - printf("Usage : %s nr_readers nr_writers duration (s)", argv[0]); + printf("Usage : %s nr_readers nr_writers duration (s) \n", + argv[0]); + printf("OPTIONS:\n"); #ifdef DEBUG_YIELD - printf(" [-r] [-w] (yield reader and/or writer)"); + printf(" [-r] [-w] (yield reader and/or writer)\n"); #endif - printf(" [-d delay] (writer period (us))"); - printf(" [-c duration] (reader C.S. duration (in loops))"); - printf(" [-e duration] (writer C.S. duration (in loops))"); - printf(" [-v] (verbose output)"); - printf(" [-a cpu#] [-a cpu#]... (affinity)"); + printf(" [-d delay] (writer period (us))\n"); + printf(" [-c duration] (reader C.S. duration (in loops))\n"); + printf(" [-e duration] (writer C.S. duration (in loops))\n"); + printf(" [-v] (verbose output)\n"); + printf(" [-a cpu#] [-a cpu#]... (affinity)\n"); printf("\n"); }