|
From: <sv...@va...> - 2011-07-30 16:55:22
|
Author: bart
Date: 2011-07-30 17:50:33 +0100 (Sat, 30 Jul 2011)
New Revision: 11953
Log:
Yet another thread test scheduler sensitivity fix
Modified:
trunk/drd/tests/annotate_hb_race.c
Modified: trunk/drd/tests/annotate_hb_race.c
===================================================================
--- trunk/drd/tests/annotate_hb_race.c 2011-07-30 11:26:57 UTC (rev 11952)
+++ trunk/drd/tests/annotate_hb_race.c 2011-07-30 16:50:33 UTC (rev 11953)
@@ -27,16 +27,20 @@
int main(int argc, char** argv)
{
+ const struct timespec delay = { 0, 100 * 1000 * 1000 };
pthread_t tid[2];
int result[2];
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]);
+
+ nanosleep(&delay, 0);
+
s_i = 1;
pthread_join(tid[0], NULL);
- //pthread_join(tid[1], NULL);
+ pthread_join(tid[1], NULL);
fprintf(stderr, "Done.\n");
|