diff options
Diffstat (limited to 'testsuites/psxtests/psxcond01/init.c')
-rw-r--r-- | testsuites/psxtests/psxcond01/init.c | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/testsuites/psxtests/psxcond01/init.c b/testsuites/psxtests/psxcond01/init.c index f87eca2236..ebf65f9694 100644 --- a/testsuites/psxtests/psxcond01/init.c +++ b/testsuites/psxtests/psxcond01/init.c @@ -1,5 +1,5 @@ /* - * COPYRIGHT (c) 1989-2012. + * COPYRIGHT (c) 1989-2013. * On-Line Applications Research Corporation (OAR). * * The license and distribution terms for this file may be @@ -27,10 +27,23 @@ void *BlockingThread( void *argument ) { + int sc; + + puts( "BlockingThread - pthread_cond_wait with mutex not locked - EPERM" ); + sc = pthread_cond_wait( &Condition, &Mutex1 ); + fatal_posix_service_status( sc, EPERM, "mutex1 not locked" ); + + sc = pthread_mutex_lock( &Mutex1 ); + fatal_posix_service_status( sc, 0, "mutex1 lock" ); + puts( "BlockingThread - pthread_cond_wait on Mutex1 - OK" ); - (void) pthread_cond_wait( &Condition, &Mutex1 ); + sc = pthread_cond_wait( &Condition, &Mutex1 ); - puts( "ERROR - BlockingThread returned from pthread_cond_wait!" ); + printf( + "ERROR - BlockingThread returned from pthread_cond_wait! (rc=%d/%s)\n", + sc, + strerror(sc) + ); rtems_test_exit( 0 ); return NULL; |