From eec08efc9048111f47f42142c30a92683bf6756c Mon Sep 17 00:00:00 2001 From: Sebastian Huber Date: Wed, 15 Jun 2016 06:59:57 +0200 Subject: posix: Rework sporadic server scheduling policy Instead of lowering the priority in case the initial budget is consumed raise the priority for each new period. Restore the normal priority once the initial budget is consumed. This makes it later easier to combine the high priority phase with temporary priority boosts (e.g. via priority ceiling and inheritance). Use the thread lock to protect the POSIX thread attributes instead of the thread state lock. This makes it easier to change the thread priority and keep the POSIX attributes consistent. Fixes a false positive use of uninitialized variable warning. --- cpukit/posix/include/rtems/posix/threadsup.h | 26 ++++++++++++++++++++------ 1 file changed, 20 insertions(+), 6 deletions(-) (limited to 'cpukit/posix/include/rtems/posix/threadsup.h') diff --git a/cpukit/posix/include/rtems/posix/threadsup.h b/cpukit/posix/include/rtems/posix/threadsup.h index e18a42995a..21977be210 100644 --- a/cpukit/posix/include/rtems/posix/threadsup.h +++ b/cpukit/posix/include/rtems/posix/threadsup.h @@ -18,10 +18,7 @@ #ifndef _RTEMS_POSIX_THREADSUP_H #define _RTEMS_POSIX_THREADSUP_H -#include -#include #include -#include #include #include @@ -50,10 +47,27 @@ typedef struct { pthread_attr_t Attributes; /** - * This is the timer which controls when the thread executes at - * high and low priority when using the sporadic scheduler. + * @brief Control block for the sporadic server scheduling policy. */ - Watchdog_Control Sporadic_timer; + struct { + /** + * @brief This is the timer which controls when the thread executes at high + * and low priority when using the sporadic server scheduling policy. + */ + Watchdog_Control Timer; + + /** + * @brief The low priority when using the sporadic server scheduling + * policy. + */ + Priority_Control low_priority; + + /** + * @brief The high priority when using the sporadic server scheduling + * policy. + */ + Priority_Control high_priority; + } Sporadic; /** This is the set of signals which are currently unblocked. */ sigset_t signals_unblocked; -- cgit v1.2.3