From: Bart Van Assche Date: Thu, 28 Jul 2011 17:41:49 +0000 (+0000) Subject: Two more scheduler sensitivity fixes for thread tool regression tests X-Git-Tag: svn/VALGRIND_3_7_0~306 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=19cbbaf2ae0f75200233a1764ac60af4549d3ff9;p=thirdparty%2Fvalgrind.git Two more scheduler sensitivity fixes for thread tool regression tests git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11931 --- diff --git a/drd/tests/annotate_hb_race.c b/drd/tests/annotate_hb_race.c index 0c2b450f9f..e14d119825 100644 --- a/drd/tests/annotate_hb_race.c +++ b/drd/tests/annotate_hb_race.c @@ -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"); diff --git a/helgrind/tests/tc16_byterace.c b/helgrind/tests/tc16_byterace.c index 70a9101a6e..f090b96a66 100644 --- a/helgrind/tests/tc16_byterace.c +++ b/helgrind/tests/tc16_byterace.c @@ -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++)