X-Git-Url: http://git.liburcu.org/?p=urcu.git;a=blobdiff_plain;f=tests%2Fbenchmark%2Ftest_mutex.c;h=049913c8d8fd62bc11fadffd290805cd2d853384;hp=919654daa063d6589ec3e51ed99a8a8bc2c30a97;hb=4b2d70a71f5d7ac75c9eb2589c3df26a2ed0684a;hpb=f61dfd97f545ebbc45fafd96b57bdc6eb655716d diff --git a/tests/benchmark/test_mutex.c b/tests/benchmark/test_mutex.c index 919654d..049913c 100644 --- a/tests/benchmark/test_mutex.c +++ b/tests/benchmark/test_mutex.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 @@ -181,8 +177,11 @@ void *thr_reader(void *data) } for (;;) { + int v; + pthread_mutex_lock(&lock); - assert(test_array.a == 8); + v = test_array.a; + assert(v == 8); if (caa_unlikely(rduration)) loop_sleep(rduration); pthread_mutex_unlock(&lock); @@ -237,9 +236,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"); @@ -285,14 +281,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);