summaryrefslogtreecommitdiffstats
path: root/testsuites/psxtests/psx07/init.c
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@OARcorp.com>2009-08-19 14:55:24 +0000
committerJoel Sherrill <joel.sherrill@OARcorp.com>2009-08-19 14:55:24 +0000
commit712726d3df9965ddf15e9e9d61af79268a453e3a (patch)
treececf989ca45babe0c7be421f22d91480064790b7 /testsuites/psxtests/psx07/init.c
parent2009-08-18 Joel Sherrill <joel.sherrill@OARcorp.com> (diff)
downloadrtems-712726d3df9965ddf15e9e9d61af79268a453e3a.tar.bz2
2009-08-19 Joel Sherrill <joel.sherrill@OARcorp.com>
* psx07/init.c, psx07/psx07.scn, psx07/system.h, psx07/task.c: Update test to reflect not allowing poriority changes when mutex is locked.
Diffstat (limited to 'testsuites/psxtests/psx07/init.c')
-rw-r--r--testsuites/psxtests/psx07/init.c34
1 files changed, 34 insertions, 0 deletions
diff --git a/testsuites/psxtests/psx07/init.c b/testsuites/psxtests/psx07/init.c
index 4db4d4552e..56f7ebdf5d 100644
--- a/testsuites/psxtests/psx07/init.c
+++ b/testsuites/psxtests/psx07/init.c
@@ -555,6 +555,40 @@ void *POSIX_Init(
status = pthread_setschedparam( pthread_self(), SCHED_SPORADIC, &schedparam );
fatal_directive_check_status_only( status, EINVAL, "invalid priority" );
+ /*
+ * Create a sporadic thread that doesn't need it's priority
+ * boosted
+ */
+ empty_line();
+
+ puts( "Init - pthread_attr_init - SUCCESSFUL" );
+ status = pthread_attr_init( &attr );
+ posix_service_failed( status, "pthread_attr_init" );
+
+ puts( "Init - pthread_attr_setinheritsched - EXPLICIT - SUCCESSFUL" );
+ status = pthread_attr_setinheritsched( &attr, PTHREAD_EXPLICIT_SCHED );
+ assert( !status );
+
+ schedparam.ss_replenish_period.tv_sec = 3;
+ schedparam.ss_replenish_period.tv_nsec = 3;
+ schedparam.ss_initial_budget.tv_sec = 1;
+ schedparam.ss_initial_budget.tv_nsec = 1;
+ schedparam.sched_priority = sched_get_priority_max( SCHED_FIFO );
+ schedparam.ss_low_priority = sched_get_priority_max( SCHED_FIFO ) - 6;
+
+ puts( "Init - pthread_attr_setschedpolicy - SUCCESSFUL" );
+ status = pthread_attr_setschedpolicy( &attr, SCHED_SPORADIC );
+ posix_service_failed( status, "pthread_attr_setschedparam");
+ puts( "Init - pthread_attr_setschedparam - SUCCESSFUL" );
+ status = pthread_attr_setschedparam( &attr, &schedparam );
+ posix_service_failed( status, "pthread_attr_setschedparam");
+
+ status = pthread_create( &Task2_id, &attr, Task_2, NULL );
+ assert( !status );
+
+ status = pthread_join( Task2_id, NULL );
+ posix_service_failed( status, " pthread_join");
+
puts( "*** END OF POSIX TEST 7 ***" );
rtems_test_exit( 0 );