summaryrefslogtreecommitdiffstats
path: root/testsuites/psxtests/psx05/init.c
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@OARcorp.com>1996-07-04 17:38:55 +0000
committerJoel Sherrill <joel.sherrill@OARcorp.com>1996-07-04 17:38:55 +0000
commitce78b89451d7c2b44afbe1796d6e3c6403970650 (patch)
tree75d55be6d4478b1f607948b86dd550528e468dfb /testsuites/psxtests/psx05/init.c
parentfirst test cases for mutex manager pass (diff)
downloadrtems-ce78b89451d7c2b44afbe1796d6e3c6403970650.tar.bz2
added test case for timeout using pthread_mutex_timedlock
Diffstat (limited to 'testsuites/psxtests/psx05/init.c')
-rw-r--r--testsuites/psxtests/psx05/init.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/testsuites/psxtests/psx05/init.c b/testsuites/psxtests/psx05/init.c
index f2b09cefd7..dea46f8714 100644
--- a/testsuites/psxtests/psx05/init.c
+++ b/testsuites/psxtests/psx05/init.c
@@ -77,6 +77,7 @@ void *POSIX_Init(
{
int status;
pthread_mutexattr_t attr;
+ struct timespec times;
puts( "\n\n*** POSIX TEST 5 ***" );
@@ -164,6 +165,18 @@ void *POSIX_Init(
printf( "status = %d\n", status );
assert( status == EPERM );
+ times.tv_sec = 0;
+ times.tv_nsec = 500000000;
+ printf( "Init: pthread_mutex_timedlock time out in 1/2 second\n" );
+ status = pthread_mutex_timedlock( &Mutex_id, &times );
+ if ( status != EAGAIN )
+ printf( "status = %d\n", status );
+ assert( status == EAGAIN );
+
+ /* switch to idle */
+
+ printf( "Init: correctly timed out waiting for mutex\n" );
+
puts( "*** END OF POSIX TEST 5 ***" );
exit( 0 );