Fix: test: side-effect in assertion
[urcu.git] / tests / benchmark / test_perthreadlock.c
index cc5f47dfa7345f530572e11e9b077154cbeed3ad..b10c9cd9a15def438f04b0177388689c6f9b4fd9 100644 (file)
@@ -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);
This page took 0.022548 seconds and 4 git commands to generate.