X-Git-Url: https://git.lttng.org/?p=urcu.git;a=blobdiff_plain;f=tests%2Fbenchmark%2Ftest_rwlock.c;h=3fad9cf273bb6300143d2b6e147667aa1752accc;hp=32e3c39d99d25b5819339f4b2a4c8336ca6929eb;hb=9ee07024d322512ce099acb16774cec2766ab09f;hpb=f5ab766ee2c8300cb00ca5878b1cb464f960a66d diff --git a/tests/benchmark/test_rwlock.c b/tests/benchmark/test_rwlock.c index 32e3c39..3fad9cf 100644 --- a/tests/benchmark/test_rwlock.c +++ b/tests/benchmark/test_rwlock.c @@ -43,8 +43,6 @@ #ifndef DYNAMIC_LINK_TEST #define _LGPL_SOURCE -#else -#define debug_yield_read() #endif #include @@ -177,8 +175,11 @@ void *thr_reader(void *_count) } for (;;) { + int a; + pthread_rwlock_rdlock(&lock); - assert(test_array.a == 8); + a = test_array.a; + assert(a == 8); if (caa_unlikely(rduration)) loop_sleep(rduration); pthread_rwlock_unlock(&lock); @@ -233,9 +234,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"); @@ -281,14 +279,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);