diff options
Diffstat (limited to 'tests/condvar3_2.c')
-rw-r--r-- | tests/condvar3_2.c | 8 |
1 files changed, 8 insertions, 0 deletions
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; } |