]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Two more scheduler sensitivity fixes for thread tool regression tests
authorBart Van Assche <bvanassche@acm.org>
Thu, 28 Jul 2011 17:41:49 +0000 (17:41 +0000)
committerBart Van Assche <bvanassche@acm.org>
Thu, 28 Jul 2011 17:41:49 +0000 (17:41 +0000)
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11931

drd/tests/annotate_hb_race.c
helgrind/tests/tc16_byterace.c

index 0c2b450f9f339d10b2325cb0558fd655fe66df00..e14d11982521edef2f114f3fd26511585cc71c3d 100644 (file)
@@ -32,11 +32,11 @@ int main(int argc, char** argv)
 
   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]);
   s_i = 1;
 
   pthread_join(tid[0], NULL);
-  pthread_join(tid[1], NULL);
+  //pthread_join(tid[1], NULL);
 
   fprintf(stderr, "Done.\n");
 
index 70a9101a6e3d6a808b09a20cd697dd248a58a548..f090b96a66bee1e3080bca6ed2904c840f169727 100644 (file)
@@ -16,14 +16,14 @@ void* child_fn ( void* arg )
 
 int main ( void )
 {
+   const struct timespec delay = { 0, 100 * 1000 * 1000 };
    int i;
    pthread_t child;
-
    if (pthread_create(&child, NULL, child_fn, NULL)) {
       perror("pthread_create");
       exit(1);
    }
-
+   nanosleep(&delay, 0);
    /* Unprotected relative to child, but harmless, since different
       bytes accessed */
    for (i = 0; i < 5; i++)