diff options
Diffstat (limited to 'testsuites/sptests/sp12/pritask.c')
-rw-r--r-- | testsuites/sptests/sp12/pritask.c | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/testsuites/sptests/sp12/pritask.c b/testsuites/sptests/sp12/pritask.c index 47c74d6e1d..8aa3a0aea4 100644 --- a/testsuites/sptests/sp12/pritask.c +++ b/testsuites/sptests/sp12/pritask.c @@ -7,7 +7,7 @@ * * Output parameters: NONE * - * COPYRIGHT (c) 1989-1999. + * COPYRIGHT (c) 1989-2007. * On-Line Applications Research Corporation (OAR). * * The license and distribution terms for this file may be @@ -51,6 +51,23 @@ rtems_task Priority_task( rtems_test_exit( 0 ); } + /* special case of setting priority while holding a resource */ + { + rtems_task_priority priority; + rtems_task_priority old_priority; + + puts( "Set priority of self while holding resource" ); + status = + rtems_task_set_priority( RTEMS_SELF, RTEMS_CURRENT_PRIORITY, &priority ); + directive_failed( status, "rtems_task_set_priority get current" ); + status = rtems_task_set_priority( RTEMS_SELF, priority, &old_priority ); + directive_failed( status, "rtems_task_set_priority with resource" ); + if ( priority != old_priority ) { + printf( "priority != old_priority (%d != %d)\n", priority, old_priority ); + rtems_test_exit(0); + } + } + if ( its_index == 5 ) puts( "PRI5 - rtems_task_suspend - until all priority tasks blocked" ); status = rtems_task_suspend( RTEMS_SELF ); |