X-Git-Url: https://git.lttng.org/?p=urcu.git;a=blobdiff_plain;f=tests%2Fbenchmark%2Ftest_perthreadlock.c;h=b10c9cd9a15def438f04b0177388689c6f9b4fd9;hp=01c4fb03f8e62add0e93d725a7472028b4128fd9;hb=19d0e7ef8f7998fb256017ba2da414d78b3cb91b;hpb=f5ab766ee2c8300cb00ca5878b1cb464f960a66d diff --git a/tests/benchmark/test_perthreadlock.c b/tests/benchmark/test_perthreadlock.c index 01c4fb0..b10c9cd 100644 --- a/tests/benchmark/test_perthreadlock.c +++ b/tests/benchmark/test_perthreadlock.c @@ -43,8 +43,6 @@ #ifndef DYNAMIC_LINK_TEST #define _LGPL_SOURCE -#else -#define debug_yield_read() #endif #include @@ -185,8 +183,11 @@ void *thr_reader(void *data) } for (;;) { + int v; + pthread_mutex_lock(&per_thread_lock[tidx].lock); - assert(test_array.a == 8); + v = test_array.a; + assert(v == 8); if (caa_unlikely(rduration)) loop_sleep(rduration); pthread_mutex_unlock(&per_thread_lock[tidx].lock); @@ -246,9 +247,6 @@ void show_usage(int argc, char **argv) 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)\n"); -#endif 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"); @@ -293,14 +291,6 @@ int main(int argc, char **argv) if (argv[i][0] != '-') continue; switch (argv[i][1]) { -#ifdef DEBUG_YIELD - case 'r': - yield_active |= YIELD_READ; - break; - case 'w': - yield_active |= YIELD_WRITE; - break; -#endif case 'a': if (argc < i + 2) { show_usage(argc, argv);