Coverity detected:
CID
1021642 (#1 of 2): Side effect in assertion
(ASSERT_SIDE_EFFECT)assert_side_effect: Argument test_array of assert()
has a side effect because the variable is volatile. The containing
function might work differently in a non-debug build.
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
}
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);
}
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);