]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Yet another thread test scheduler sensitivity fix
authorBart Van Assche <bvanassche@acm.org>
Fri, 29 Jul 2011 06:12:51 +0000 (06:12 +0000)
committerBart Van Assche <bvanassche@acm.org>
Fri, 29 Jul 2011 06:12:51 +0000 (06:12 +0000)
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11936

drd/tests/annotate_barrier.c

index 5db1763d83a0b20ef81b75666e3cab1548ad00ac..592254a6c730a2826db697e498763efa9a26b1bc 100644 (file)
@@ -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++)