From 045278e11b53fc1ad59945427feab1cd9275988f Mon Sep 17 00:00:00 2001 From: rpj Date: Fri, 22 Oct 2004 15:06:41 +0000 Subject: Changes to mutexes and semaphores - considered alpha for now --- tests/condvar3_2.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'tests/condvar3_2.c') diff --git a/tests/condvar3_2.c b/tests/condvar3_2.c index 865ca9d..525ddf6 100644 --- a/tests/condvar3_2.c +++ b/tests/condvar3_2.c @@ -160,10 +160,16 @@ main() * and while some are still waking up after timeout. * Also tests that redundant broadcasts don't return errors. */ + + assert(pthread_mutex_lock(&mutex) == 0); + if (awoken > NUMTHREADS/3) { assert(pthread_cond_broadcast(&cv) == 0); } + + assert(pthread_mutex_unlock(&mutex) == 0); + } assert(awoken == NUMTHREADS - timedout); @@ -181,5 +187,7 @@ main() assert(result == 0); } + assert(pthread_mutex_destroy(&mutex) == 0); + return 0; } -- cgit v1.2.3