|
From: <sv...@va...> - 2011-07-29 06:17:40
|
Author: bart
Date: 2011-07-29 07:12:51 +0100 (Fri, 29 Jul 2011)
New Revision: 11936
Log:
Yet another thread test scheduler sensitivity fix
Modified:
trunk/drd/tests/annotate_barrier.c
Modified: trunk/drd/tests/annotate_barrier.c
===================================================================
--- trunk/drd/tests/annotate_barrier.c 2011-07-29 05:44:38 UTC (rev 11935)
+++ trunk/drd/tests/annotate_barrier.c 2011-07-29 06:12:51 UTC (rev 11936)
@@ -124,6 +124,7 @@
/* 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 @@
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++)
|