X-Git-Url: https://git.liburcu.org/?p=urcu.git;a=blobdiff_plain;f=tests%2Fbenchmark%2Ftest_perthreadlock.c;h=b10c9cd9a15def438f04b0177388689c6f9b4fd9;hp=cc5f47dfa7345f530572e11e9b077154cbeed3ad;hb=19d0e7ef8f7998fb256017ba2da414d78b3cb91b;hpb=999991c6e4600c410181baea65bda9f406464872 diff --git a/tests/benchmark/test_perthreadlock.c b/tests/benchmark/test_perthreadlock.c index cc5f47d..b10c9cd 100644 --- a/tests/benchmark/test_perthreadlock.c +++ b/tests/benchmark/test_perthreadlock.c @@ -183,8 +183,11 @@ void *thr_reader(void *data) } for (;;) { + int v; + pthread_mutex_lock(&per_thread_lock[tidx].lock); - assert(test_array.a == 8); + v = test_array.a; + assert(v == 8); if (caa_unlikely(rduration)) loop_sleep(rduration); pthread_mutex_unlock(&per_thread_lock[tidx].lock);