From 5d1fc66ce7b1afccb2537a7acb34ae7eace97f74 Mon Sep 17 00:00:00 2001 From: Sebastian Huber Date: Fri, 12 Aug 2016 15:54:46 +0200 Subject: psxtests: Adjust sporadic server tests According to POSIX priority value returned from pthread_getschedparam() shall be the value specified by the most recent pthread_setschedparam(), pthread_setschedprio(), or pthread_create() call affecting the target thread. Read this as though a temporary lower priority due to the sporadic server policy shall not be visible through pthread_getschedparam(). Thus, use rtems_task_set_priority() to get the current priority of the threads. Use a priority ceiling mutex to prevent sporadic server priority adjustments. --- testsuites/psxtests/psx09/psx09.scn | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) (limited to 'testsuites/psxtests/psx09/psx09.scn') diff --git a/testsuites/psxtests/psx09/psx09.scn b/testsuites/psxtests/psx09/psx09.scn index c3e6dadc71..766fd0f27d 100644 --- a/testsuites/psxtests/psx09/psx09.scn +++ b/testsuites/psxtests/psx09/psx09.scn @@ -1,22 +1,20 @@ -*** POSIX TEST 9 *** +*** BEGIN OF TEST PSX 9 *** Init's ID is 0x0b010001 Init: pthread_getschedparam - SUCCESSFUL Init: Fri May 24 11:05:00 1996 - current priority = 2 Init: pthread_setschedparam - SUCCESSFUL (sporadic server) -Init: Fri May 24 11:05:00 1996 - new priority = 254 Init: Fri May 24 11:05:00 1996 - new priority = 252 -Init: Fri May 24 11:05:00 1996 - new priority = 254 Init: Fri May 24 11:05:00 1996 - new priority = 252 -Init: Fri May 24 11:05:01 1996 - new priority = 254 +Init: Fri May 24 11:05:00 1996 - new priority = 253 +Init: Fri May 24 11:05:00 1996 - new priority = 252 +Init: Fri May 24 11:05:00 1996 - new priority = 253 Init: pthread_setschedparam - SUCCESSFUL (sporadic server) Init: Initializing mutex attributes for priority ceiling Init: Creating a mutex -Init: Fri May 24 11:05:01 1996 - new priority = 254 +Init: Fri May 24 11:05:00 1996 - new priority = 252 Init: pthread_mutex_lock acquire the lock -Init: Fri May 24 11:05:01 1996 - new priority = 254 -Init: Fri May 24 11:05:01 1996 - new priority = 254 Init: unlock mutex -Init: Fri May 24 11:05:01 1996 - new priority = 254 -Init: Fri May 24 11:05:01 1996 - new priority = 250 -*** END OF POSIX TEST 9 *** +Init: Fri May 24 11:05:03 1996 - new priority = 253 +Init: Fri May 24 11:05:03 1996 - new priority = 252 +*** END OF TEST PSX 9 ** -- cgit v1.2.3