]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Yet another thread test scheduler sensitivity fix
authorBart Van Assche <bvanassche@acm.org>
Sat, 30 Jul 2011 16:50:33 +0000 (16:50 +0000)
committerBart Van Assche <bvanassche@acm.org>
Sat, 30 Jul 2011 16:50:33 +0000 (16:50 +0000)
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11953

drd/tests/annotate_hb_race.c

index e14d11982521edef2f114f3fd26511585cc71c3d..14970f18253543f21faee21c307ef132bd5d6a55 100644 (file)
@@ -27,16 +27,20 @@ static void* thread_func(void* arg)
 
 int main(int argc, char** argv)
 {
+  const struct timespec delay = { 0, 100 * 1000 * 1000 };
   pthread_t tid[2];
   int result[2];
 
   U_ANNOTATE_HAPPENS_BEFORE(&s_i);
   pthread_create(&tid[0], 0, thread_func, &result[0]);
-  //pthread_create(&tid[1], 0, thread_func, &result[1]);
+  pthread_create(&tid[1], 0, thread_func, &result[1]);
+
+  nanosleep(&delay, 0);
+
   s_i = 1;
 
   pthread_join(tid[0], NULL);
-  //pthread_join(tid[1], NULL);
+  pthread_join(tid[1], NULL);
 
   fprintf(stderr, "Done.\n");