From 49325ef13cf5c25f78590e8d4c0fa4a190e985d4 Mon Sep 17 00:00:00 2001 From: Joel Sherrill Date: Mon, 17 Aug 2009 17:43:35 +0000 Subject: 2009-08-17 Santosh G Vattam * configure.ac, psx05/init.c, psx05/psx05.scn: Add test case for initializing a recursize mutex. --- testsuites/psxtests/psx05/init.c | 18 ++++++++++++++++++ testsuites/psxtests/psx05/psx05.scn | 1 + 2 files changed, 19 insertions(+) (limited to 'testsuites/psxtests/psx05') diff --git a/testsuites/psxtests/psx05/init.c b/testsuites/psxtests/psx05/init.c index 4456516d18..a36dc9240a 100644 --- a/testsuites/psxtests/psx05/init.c +++ b/testsuites/psxtests/psx05/init.c @@ -651,6 +651,24 @@ void *POSIX_Init( printf( "status = %d\n", status ); assert( status == EINVAL ); + /* mutexinit.c: Initialising recursive mutex */ + + puts( "Init: Recursive Mutex" ); + + status = pthread_mutex_destroy( &Mutex2_id ); + if( status ) + printf( "status mutex destroy:%d\n", status ); + + status = pthread_mutexattr_init( &attr ); + if( status ) + printf( "status mutexattr:%d\n", status ); + + attr.recursive=true; + status = pthread_mutex_init( &Mutex2_id, &attr ); + if ( status ) + printf( "status recursive mutex :%d\n", status ); + assert( !status ); + puts( "*** END OF POSIX TEST 5 ***" ); rtems_test_exit( 0 ); diff --git a/testsuites/psxtests/psx05/psx05.scn b/testsuites/psxtests/psx05/psx05.scn index a9d11a66e3..58351cccd7 100644 --- a/testsuites/psxtests/psx05/psx05.scn +++ b/testsuites/psxtests/psx05/psx05.scn @@ -114,4 +114,5 @@ Task 3: exit Init: pthread_mutex_getprioceiling- ceiling = 200 Init: pthread_setschedparam - set Init priority to highest Init: pthread_mutex_lock - EINVAL (priority ceiling violation) +Init: Recursive Mutex *** END OF POSIX TEST 5 *** -- cgit v1.2.3