|
From: <sv...@va...> - 2008-07-28 11:23:36
|
Author: bart Date: 2008-07-28 12:23:38 +0100 (Mon, 28 Jul 2008) New Revision: 8461 Log: Fixed race condition. Modified: trunk/drd/tests/pth_inconsistent_cond_wait.c Modified: trunk/drd/tests/pth_inconsistent_cond_wait.c =================================================================== --- trunk/drd/tests/pth_inconsistent_cond_wait.c 2008-07-24 10:34:12 UTC (rev 8460) +++ trunk/drd/tests/pth_inconsistent_cond_wait.c 2008-07-28 11:23:38 UTC (rev 8461) @@ -37,13 +37,14 @@ pthread_t tid1; pthread_t tid2; - sem_init(&s_sem, 0, 2); + sem_init(&s_sem, 0, 0); pthread_cond_init(&s_cond, 0); pthread_mutex_init(&s_mutex1, 0); pthread_mutex_init(&s_mutex2, 0); pthread_create(&tid1, 0, &thread1, 0); pthread_create(&tid2, 0, &thread2, 0); sem_wait(&s_sem); + sem_wait(&s_sem); pthread_mutex_lock(&s_mutex1); pthread_mutex_lock(&s_mutex2); pthread_mutex_unlock(&s_mutex2); |