Valgrind: r16312 - /trunk/helgrind/tests/tc23_bogus_condwait.c

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Valgrind: r16312 - /trunk/helgrind/tests/tc23_bogus_condwait.c

svn-2
Author: petarj
Date: Tue Apr 25 14:52:21 2017
New Revision: 16312

Log:
make helgrind/tc23_bogus_condwait test deterministic

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.


Modified:
    trunk/helgrind/tests/tc23_bogus_condwait.c

Modified: trunk/helgrind/tests/tc23_bogus_condwait.c
==============================================================================
--- trunk/helgrind/tests/tc23_bogus_condwait.c (original)
+++ trunk/helgrind/tests/tc23_bogus_condwait.c Tue Apr 25 14:52:21 2017
@@ -69,7 +69,7 @@
   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 );


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Valgrind-developers mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/valgrind-developers