X-Git-Url: https://git.liburcu.org/?a=blobdiff_plain;f=tests%2Fbenchmark%2Ftest_perthreadlock.c;h=ac21444191d55092c43474d7a405e9c3a4d072c1;hb=61c3fb603104bda9e67c0690c1964e61a770d045;hp=512b1fc8ff1dc1f6697c28911ce382cec3c1ebe3;hpb=83e334d03eaba62df373cf44298616458900078a;p=urcu.git diff --git a/tests/benchmark/test_perthreadlock.c b/tests/benchmark/test_perthreadlock.c index 512b1fc..ac21444 100644 --- a/tests/benchmark/test_perthreadlock.c +++ b/tests/benchmark/test_perthreadlock.c @@ -33,7 +33,6 @@ #include #include -#include "cpuset.h" #include "thread-id.h" /* hardcoded number of CPUs */ @@ -114,11 +113,7 @@ static void set_affinity(void) } CPU_ZERO(&mask); CPU_SET(cpu, &mask); -#if SCHED_SETAFFINITY_ARGS == 2 - sched_setaffinity(0, &mask); -#else sched_setaffinity(0, sizeof(mask), &mask); -#endif #endif /* HAVE_SCHED_SETAFFINITY */ } @@ -170,6 +165,7 @@ static void urcu_mutex_unlock(pthread_mutex_t *lock) } } +static void *thr_reader(void *data) { unsigned long tidx = (unsigned long)data; @@ -204,6 +200,7 @@ void *thr_reader(void *data) } +static void *thr_writer(void *data) { unsigned long wtidx = (unsigned long)data; @@ -220,7 +217,7 @@ void *thr_writer(void *data) cmm_smp_mb(); for (;;) { - for (tidx = 0; tidx < nr_readers; tidx++) { + for (tidx = 0; tidx < (long)nr_readers; tidx++) { urcu_mutex_lock(&per_thread_lock[tidx].lock); } test_array.a = 0; @@ -243,6 +240,7 @@ void *thr_writer(void *data) return ((void*)2); } +static void show_usage(int argc, char **argv) { printf("Usage : %s nr_readers nr_writers duration (s) \n",