From: Bart Van Assche Date: Fri, 29 Jul 2011 06:12:51 +0000 (+0000) Subject: Yet another thread test scheduler sensitivity fix X-Git-Tag: svn/VALGRIND_3_7_0~301 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fe979eb8e90932399d2056ed1c1dd4fbad88f520;p=thirdparty%2Fvalgrind.git Yet another thread test scheduler sensitivity fix git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11936 --- diff --git a/drd/tests/annotate_barrier.c b/drd/tests/annotate_barrier.c index 5db1763d83..592254a6c7 100644 --- a/drd/tests/annotate_barrier.c +++ b/drd/tests/annotate_barrier.c @@ -124,6 +124,7 @@ static void* threadfunc(struct threadinfo* p) /* Actual test, consisting of nthread threads. */ static void barriers_and_races(const int nthread, const int iterations) { + const struct timespec delay = { 0, 100 * 1000 * 1000 }; int i; struct threadinfo* t; barrier_t b; @@ -144,6 +145,7 @@ static void barriers_and_races(const int nthread, const int iterations) t[i].array = array; t[i].iterations = iterations; pthread_create(&t[i].tid, 0, (void*(*)(void*))threadfunc, &t[i]); + nanosleep(&delay, 0); } for (i = 0; i < nthread; i++)