Fix: test: side-effect in assertion
[urcu.git] / tests / benchmark / test_mutex.c
index 574d0e8cfce8efb3363c32c8acdae103113b27df..81efcaeb33d77949b3bf7abec625082d18a43819 100644 (file)
@@ -179,8 +179,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);
This page took 0.02349 seconds and 4 git commands to generate.