]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
make helgrind/tc23_bogus_condwait test deterministic
authorPetar Jovanovic <mips32r2@gmail.com>
Tue, 25 Apr 2017 13:52:21 +0000 (13:52 +0000)
committerPetar Jovanovic <mips32r2@gmail.com>
Tue, 25 Apr 2017 13:52:21 +0000 (13:52 +0000)
Using properly initialized mutex (instead of a dirty one) in case
"mx is not locked" makes behavior of this test deterministic.

Patch by Tamara Vlahovic.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16312

helgrind/tests/tc23_bogus_condwait.c

index 0a1b5f36549b27030037c5d8b5d9cd2285f50607..6ea5ad90be08ace1a44859d005f53901d68fba91 100644 (file)
@@ -69,7 +69,7 @@ int main ( void )
   r= pthread_cond_wait(&cv, (pthread_mutex_t*)(4 + (char*)&mx[0]) );
 
   /* mx is not locked */
-  r= pthread_cond_wait(&cv, &mx[0]);
+  r= pthread_cond_wait(&cv, &mx[3]);
 
   /* wrong flavour of lock */
   r= pthread_cond_wait(&cv, (pthread_mutex_t*)&rwl );