X-Git-Url: http://git.lttng.org/?a=blobdiff_plain;f=tests%2Fbenchmark%2Ftest_rwlock.c;h=444859770fbc1127c1b73afa88084d8a4fee103e;hb=6893800a4d1cc14dff0395ddcd660a5138db183d;hp=32e3c39d99d25b5819339f4b2a4c8336ca6929eb;hpb=f5ab766ee2c8300cb00ca5878b1cb464f960a66d;p=urcu.git diff --git a/tests/benchmark/test_rwlock.c b/tests/benchmark/test_rwlock.c index 32e3c39..4448597 100644 --- a/tests/benchmark/test_rwlock.c +++ b/tests/benchmark/test_rwlock.c @@ -20,8 +20,6 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -#define _GNU_SOURCE -#include "config.h" #include #include #include @@ -43,8 +41,6 @@ #ifndef DYNAMIC_LINK_TEST #define _LGPL_SOURCE -#else -#define debug_yield_read() #endif #include @@ -177,8 +173,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 +232,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 +277,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);