X-Git-Url: https://git.lttng.org/?p=urcu.git;a=blobdiff_plain;f=tests%2Fbenchmark%2Ftest_perthreadlock_timing.c;h=34aae5fdba7918c1623b963deb5367ca195e571b;hp=ca2953d0d43fdd705f42db6b766f5226d4f39a09;hb=014775106c60f02818ca755b331f887030bd440f;hpb=4104b71fb1810c7a61ab76e3fbaec0ea88f6fd75 diff --git a/tests/benchmark/test_perthreadlock_timing.c b/tests/benchmark/test_perthreadlock_timing.c index ca2953d..34aae5f 100644 --- a/tests/benchmark/test_perthreadlock_timing.c +++ b/tests/benchmark/test_perthreadlock_timing.c @@ -28,11 +28,11 @@ #include #include #include -#include #include #include #include +#include #include "thread-id.h" @@ -67,6 +67,7 @@ static int num_write; static caa_cycles_t __attribute__((aligned(CAA_CACHE_LINE_SIZE))) *reader_time; static caa_cycles_t __attribute__((aligned(CAA_CACHE_LINE_SIZE))) *writer_time; +static void *thr_reader(void *arg) { caa_cycles_t time1, time2; @@ -86,7 +87,7 @@ void *thr_reader(void *arg) perror("Error in pthread mutex lock"); exit(-1); } - assert(test_array.a == 8); + urcu_posix_assert(test_array.a == 8); ret = pthread_mutex_unlock(&per_thread_lock[tidx].lock); if (ret) { perror("Error in pthread mutex unlock"); @@ -105,6 +106,7 @@ void *thr_reader(void *arg) } +static void *thr_writer(void *arg) { caa_cycles_t time1, time2;