Index: cpukit/posix/include/rtems/posix/pthreadimpl.h
===================================================================
--- cpukit/posix/include/rtems/posix/pthreadimpl.h	(revision 6bab009a61ae9ca7f7ac76140f8f13fbaab784c6)
+++ cpukit/posix/include/rtems/posix/pthreadimpl.h	(revision eec08efc9048111f47f42142c30a92683bf6756c)
@@ -63,5 +63,5 @@
 
   _Watchdog_Per_CPU_insert_relative(
-    &api->Sporadic_timer,
+    &api->Sporadic.Timer,
     _Per_CPU_Get(),
     _Timespec_To_ticks( &api->Attributes.schedparam.sched_ss_repl_period )
@@ -80,19 +80,4 @@
   Thread_Control *the_thread
 );
-
-/**
- * This routine supports the sporadic scheduling algorithm.  It
- * is scheduled to be executed at the end of each replenishment
- * period.  In sporadic scheduling a thread will execute at a
- * high priority for a user specified amount of CPU time.  When
- * it exceeds that amount of CPU time, its priority is automatically
- * lowered. This TSR is executed when it is time to replenish
- * the thread's processor budget and raise its priority.
- *
- * @param[in] id is ignored
- * @param[in] argument is a pointer to the Thread_Control structure
- *            for the thread being replenished.
- */
-void _POSIX_Threads_Sporadic_budget_TSR( Watchdog_Control *watchdog );
 
 /**
Index: cpukit/posix/include/rtems/posix/threadsup.h
===================================================================
--- cpukit/posix/include/rtems/posix/threadsup.h	(revision 6bab009a61ae9ca7f7ac76140f8f13fbaab784c6)
+++ cpukit/posix/include/rtems/posix/threadsup.h	(revision eec08efc9048111f47f42142c30a92683bf6756c)
@@ -19,8 +19,5 @@
 #define _RTEMS_POSIX_THREADSUP_H
 
-#include <rtems/score/coresem.h>
-#include <rtems/score/isrlock.h>
 #include <rtems/score/thread.h>
-#include <rtems/score/threadq.h>
 #include <rtems/score/watchdog.h>
 
@@ -51,8 +48,25 @@
 
   /**
-   * 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. */
Index: cpukit/posix/src/psxtransschedparam.c
===================================================================
--- cpukit/posix/src/psxtransschedparam.c	(revision 6bab009a61ae9ca7f7ac76140f8f13fbaab784c6)
+++ cpukit/posix/src/psxtransschedparam.c	(revision eec08efc9048111f47f42142c30a92683bf6756c)
@@ -22,7 +22,5 @@
 #include <errno.h>
 
-#include <rtems/system.h>
 #include <rtems/posix/pthreadimpl.h>
-#include <rtems/posix/priorityimpl.h>
 
 int _POSIX_Thread_Translate_sched_param(
@@ -33,7 +31,4 @@
 )
 {
-  if ( !_POSIX_Priority_Is_valid( param->sched_priority ) )
-    return EINVAL;
-
   *budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_NONE;
   *budget_callout = NULL;
@@ -67,7 +62,4 @@
       return EINVAL;
 
-    if ( !_POSIX_Priority_Is_valid( param->sched_ss_low_priority ) )
-      return EINVAL;
-
     *budget_algorithm  = THREAD_CPU_BUDGET_ALGORITHM_CALLOUT;
     *budget_callout = _POSIX_Threads_Sporadic_budget_callout;
Index: cpukit/posix/src/pthread.c
===================================================================
--- cpukit/posix/src/pthread.c	(revision 6bab009a61ae9ca7f7ac76140f8f13fbaab784c6)
+++ cpukit/posix/src/pthread.c	(revision eec08efc9048111f47f42142c30a92683bf6756c)
@@ -82,50 +82,42 @@
 };
 
-static bool _POSIX_Threads_Sporadic_budget_TSR_filter(
+static bool _POSIX_Threads_Sporadic_timer_filter(
   Thread_Control   *the_thread,
-  Priority_Control *new_priority,
+  Priority_Control *new_priority_p,
   void             *arg
 )
 {
-  the_thread->real_priority = *new_priority;
-
-  /*
-   * If holding a resource, then do not change it.
-   *
-   * If this would make them less important, then do not change it.
-   */
-  return !_Thread_Owns_resources( the_thread ) &&
-    _Thread_Priority_less_than( the_thread->current_priority, *new_priority );
-}
-
-/*
- *  _POSIX_Threads_Sporadic_budget_TSR
- */
-void _POSIX_Threads_Sporadic_budget_TSR( Watchdog_Control *watchdog )
-{
-  POSIX_API_Control  *api;
-  Thread_Control     *the_thread;
-  ISR_lock_Context    lock_context;
-  Priority_Control    new_priority;
-
-  api = RTEMS_CONTAINER_OF( watchdog, POSIX_API_Control, Sporadic_timer );
+  POSIX_API_Control *api;
+  Priority_Control   current_priority;
+  Priority_Control   new_priority;
+
+  api = arg;
+
+  new_priority = api->Sporadic.high_priority;
+  *new_priority_p = new_priority;
+
+  current_priority = the_thread->current_priority;
+  the_thread->real_priority = new_priority;
+
+  _Watchdog_Per_CPU_remove_relative( &api->Sporadic.Timer );
+  _POSIX_Threads_Sporadic_timer_insert( the_thread, api );
+
+  return _Thread_Priority_less_than( current_priority, new_priority )
+    || !_Thread_Owns_resources( the_thread );
+}
+
+static void _POSIX_Threads_Sporadic_timer( Watchdog_Control *watchdog )
+{
+  POSIX_API_Control *api;
+  Thread_Control    *the_thread;
+
+  api = RTEMS_CONTAINER_OF( watchdog, POSIX_API_Control, Sporadic.Timer );
   the_thread = api->thread;
-
-  _Thread_State_acquire( the_thread, &lock_context );
-
-  _Watchdog_Per_CPU_remove_relative( &api->Sporadic_timer );
-  _POSIX_Threads_Sporadic_timer_insert( the_thread, api );
-
-  new_priority = _POSIX_Priority_To_core(
-    api->Attributes.schedparam.sched_priority
-  );
-
-  _Thread_State_release( the_thread, &lock_context );
 
   _Thread_Change_priority(
     the_thread,
-    new_priority,
-    NULL,
-    _POSIX_Threads_Sporadic_budget_TSR_filter,
+    0,
+    api,
+    _POSIX_Threads_Sporadic_timer_filter,
     true
   );
@@ -134,29 +126,11 @@
 static bool _POSIX_Threads_Sporadic_budget_callout_filter(
   Thread_Control   *the_thread,
-  Priority_Control *new_priority,
+  Priority_Control *new_priority_p,
   void             *arg
 )
 {
-  the_thread->real_priority = *new_priority;
-
-  /*
-   * If holding a resource, then do not change it.
-   *
-   * Make sure we are actually lowering it. If they have lowered it
-   * to logically lower than sched_ss_low_priority, then we do not want to
-   * change it.
-   */
-  return !_Thread_Owns_resources( the_thread ) &&
-    _Thread_Priority_less_than( *new_priority, the_thread->current_priority );
-}
-
-/*
- *  _POSIX_Threads_Sporadic_budget_callout
- */
-void _POSIX_Threads_Sporadic_budget_callout(
-  Thread_Control *the_thread
-)
-{
-  POSIX_API_Control *api;
+  POSIX_API_Control *api;
+  Priority_Control   current_priority;
+  Priority_Control   new_priority;
 
   api = the_thread->API_Extensions[ THREAD_API_POSIX ];
@@ -168,9 +142,19 @@
   the_thread->cpu_time_budget = UINT32_MAX;
 
+  new_priority = api->Sporadic.low_priority;
+  *new_priority_p = new_priority;
+
+  current_priority = the_thread->current_priority;
+  the_thread->real_priority = new_priority;
+
+  return _Thread_Priority_less_than( current_priority, new_priority )
+    || !_Thread_Owns_resources( the_thread );
+}
+
+void _POSIX_Threads_Sporadic_budget_callout( Thread_Control *the_thread )
+{
   _Thread_Change_priority(
     the_thread,
-    _POSIX_Priority_To_core(
-      api->Attributes.schedparam.sched_ss_low_priority
-    ),
+    0,
     NULL,
     _POSIX_Threads_Sporadic_budget_callout_filter,
@@ -218,9 +202,6 @@
   }
 
-  _Watchdog_Preinitialize( &api->Sporadic_timer, _Per_CPU_Get_by_index( 0 ) );
-  _Watchdog_Initialize(
-    &api->Sporadic_timer,
-    _POSIX_Threads_Sporadic_budget_TSR
-  );
+  _Watchdog_Preinitialize( &api->Sporadic.Timer, _Per_CPU_Get_by_index( 0 ) );
+  _Watchdog_Initialize( &api->Sporadic.Timer, _POSIX_Threads_Sporadic_timer );
 
   return true;
@@ -237,5 +218,5 @@
 
   if ( api->Attributes.schedpolicy == SCHED_SPORADIC ) {
-    _Watchdog_Per_CPU_remove_relative( &api->Sporadic_timer );
+    _Watchdog_Per_CPU_remove_relative( &api->Sporadic.Timer );
   }
 
Index: cpukit/posix/src/pthreadcreate.c
===================================================================
--- cpukit/posix/src/pthreadcreate.c	(revision 6bab009a61ae9ca7f7ac76140f8f13fbaab784c6)
+++ cpukit/posix/src/pthreadcreate.c	(revision eec08efc9048111f47f42142c30a92683bf6756c)
@@ -61,5 +61,8 @@
   };
   const pthread_attr_t               *the_attr;
-  Priority_Control                    core_priority;
+  int                                 low_prio;
+  int                                 high_prio;
+  Priority_Control                    core_low_prio;
+  Priority_Control                    core_high_prio;
   Thread_CPU_budget_algorithms        budget_algorithm;
   Thread_CPU_budget_algorithm_callout budget_callout;
@@ -72,5 +75,5 @@
   struct sched_param                  schedparam;
   Objects_Name                        name;
-  int                                 rc;
+  int                                 error;
   ISR_lock_Context                    lock_context;
 
@@ -131,16 +134,5 @@
     return ENOTSUP;
 
-  /*
-   *  Interpret the scheduling parameters.
-   */
-  if ( !_POSIX_Priority_Is_valid( schedparam.sched_priority ) )
-    return EINVAL;
-
-  core_priority = _POSIX_Priority_To_core( schedparam.sched_priority );
-
-  /*
-   *  Set the core scheduling policy information.
-   */
-  rc = _POSIX_Thread_Translate_sched_param(
+  error = _POSIX_Thread_Translate_sched_param(
     schedpolicy,
     &schedparam,
@@ -148,6 +140,26 @@
     &budget_callout
   );
-  if ( rc )
-    return rc;
+  if ( error != 0 ) {
+    return error;
+  }
+
+  if ( schedpolicy == SCHED_SPORADIC ) {
+    low_prio = schedparam.sched_ss_low_priority;
+    high_prio = schedparam.sched_priority;
+  } else {
+    low_prio = schedparam.sched_priority;
+    high_prio = low_prio;
+  }
+
+  if ( !_POSIX_Priority_Is_valid( low_prio ) ) {
+    return EINVAL;
+  }
+
+  if ( !_POSIX_Priority_Is_valid( high_prio ) ) {
+    return EINVAL;
+  }
+
+  core_low_prio = _POSIX_Priority_To_core( low_prio );
+  core_high_prio = _POSIX_Priority_To_core( high_prio );
 
 #if defined(RTEMS_SMP)
@@ -187,5 +199,5 @@
     _POSIX_Threads_Ensure_minimum_stack(the_attr->stacksize),
     is_fp,
-    core_priority,
+    core_high_prio,
     true,                 /* preemptible */
     budget_algorithm,
@@ -227,4 +239,6 @@
 
   _POSIX_Threads_Copy_attributes( &api->Attributes, the_attr );
+  api->Sporadic.low_priority = core_low_prio;
+  api->Sporadic.high_priority = core_high_prio;
 
   if ( schedpolicy == SCHED_SPORADIC ) {
Index: cpukit/posix/src/pthreadgetschedparam.c
===================================================================
--- cpukit/posix/src/pthreadgetschedparam.c	(revision 6bab009a61ae9ca7f7ac76140f8f13fbaab784c6)
+++ cpukit/posix/src/pthreadgetschedparam.c	(revision eec08efc9048111f47f42142c30a92683bf6756c)
@@ -49,7 +49,8 @@
   }
 
-  _Thread_State_acquire_critical( the_thread, &lock_context );
+  api = the_thread->API_Extensions[ THREAD_API_POSIX ];
 
-  api = the_thread->API_Extensions[ THREAD_API_POSIX ];
+  _Thread_Lock_acquire_default_critical( the_thread, &lock_context );
+
   *policy = api->Attributes.schedpolicy;
   *param  = api->Attributes.schedparam;
@@ -58,5 +59,5 @@
   );
 
-  _Thread_State_release( the_thread, &lock_context );
+  _Thread_Lock_release_default( the_thread, &lock_context );
   return 0;
 }
Index: cpukit/posix/src/pthreadsetschedparam.c
===================================================================
--- cpukit/posix/src/pthreadsetschedparam.c	(revision 6bab009a61ae9ca7f7ac76140f8f13fbaab784c6)
+++ cpukit/posix/src/pthreadsetschedparam.c	(revision eec08efc9048111f47f42142c30a92683bf6756c)
@@ -29,6 +29,80 @@
 #include <rtems/posix/priorityimpl.h>
 #include <rtems/score/threadimpl.h>
-#include <rtems/score/watchdogimpl.h>
-#include <rtems/config.h>
+
+typedef struct {
+  int                                  policy;
+  const struct sched_param            *param;
+  Thread_CPU_budget_algorithms         budget_algorithm;
+  Thread_CPU_budget_algorithm_callout  budget_callout;
+  int                                  error;
+} POSIX_Set_sched_param_context;
+
+static bool _POSIX_Set_sched_param_filter(
+  Thread_Control   *the_thread,
+  Priority_Control *new_priority_p,
+  void             *arg
+)
+{
+  POSIX_Set_sched_param_context *context;
+  const struct sched_param      *param;
+  POSIX_API_Control             *api;
+  int                            low_prio;
+  int                            high_prio;
+  Priority_Control               core_low_prio;
+  Priority_Control               core_high_prio;
+  Priority_Control               current_priority;
+
+  context = arg;
+  param = context->param;
+
+  if ( context->policy == SCHED_SPORADIC ) {
+    low_prio = param->sched_ss_low_priority;
+    high_prio = param->sched_priority;
+  } else {
+    low_prio = param->sched_priority;
+    high_prio = low_prio;
+  }
+
+  if ( !_POSIX_Priority_Is_valid( low_prio ) ) {
+    context->error = EINVAL;
+    return false;
+  }
+
+  if ( !_POSIX_Priority_Is_valid( high_prio ) ) {
+    context->error = EINVAL;
+    return false;
+  }
+
+  core_low_prio = _POSIX_Priority_To_core( low_prio );
+  core_high_prio = _POSIX_Priority_To_core( high_prio );
+
+  *new_priority_p = core_high_prio;
+
+  current_priority = the_thread->current_priority;
+  the_thread->real_priority = core_high_prio;
+
+  api = the_thread->API_Extensions[ THREAD_API_POSIX ];
+
+  _Watchdog_Per_CPU_remove_relative( &api->Sporadic.Timer );
+
+  api->Attributes.schedpolicy = context->policy;
+  api->Attributes.schedparam  = *param;
+  api->Sporadic.low_priority  = core_low_prio;
+  api->Sporadic.high_priority = core_high_prio;
+
+  the_thread->budget_algorithm = context->budget_algorithm;
+  the_thread->budget_callout   = context->budget_callout;
+
+  if ( context->policy == SCHED_SPORADIC ) {
+    _POSIX_Threads_Sporadic_timer_insert( the_thread, api );
+  } else {
+    the_thread->cpu_time_budget =
+      rtems_configuration_get_ticks_per_timeslice();
+  }
+
+  context->error = 0;
+  return _Thread_Priority_less_than( current_priority, core_high_prio )
+    || !_Thread_Owns_resources( the_thread );
+}
 
 int pthread_setschedparam(
@@ -38,17 +112,9 @@
 )
 {
-  Thread_Control                      *the_thread;
-  Per_CPU_Control                     *cpu_self;
-  POSIX_API_Control                   *api;
-  Thread_CPU_budget_algorithms         budget_algorithm;
-  Thread_CPU_budget_algorithm_callout  budget_callout;
-  int                                  eno;
-  Priority_Control                     unused;
-  ISR_lock_Context                     lock_context;
-  Priority_Control                     new_priority;
-
-  /*
-   *  Check all the parameters
-   */
+  Thread_Control                *the_thread;
+  Per_CPU_Control               *cpu_self;
+  POSIX_Set_sched_param_context  context;
+  ISR_lock_Context               lock_context;
+  int                            error;
 
   if ( param == NULL ) {
@@ -56,13 +122,16 @@
   }
 
-  eno = _POSIX_Thread_Translate_sched_param(
+  error = _POSIX_Thread_Translate_sched_param(
     policy,
     param,
-    &budget_algorithm,
-    &budget_callout
+    &context.budget_algorithm,
+    &context.budget_callout
   );
-  if ( eno != 0 ) {
-    return eno;
+  if ( error != 0 ) {
+    return error;
   }
+
+  context.policy = policy;
+  context.param = param;
 
   the_thread = _Thread_Get( thread, &lock_context );
@@ -72,50 +141,16 @@
   }
 
-  /*
-   *  Actually change the scheduling policy and parameters
-   */
+  cpu_self = _Thread_Dispatch_disable_critical( &lock_context );
+  _ISR_lock_ISR_enable( &lock_context );
 
-  cpu_self = _Thread_Dispatch_disable_critical( &lock_context );
-  _Thread_State_acquire_critical( the_thread, &lock_context );
-
-  api = the_thread->API_Extensions[ THREAD_API_POSIX ];
-
-  if ( api->Attributes.schedpolicy == SCHED_SPORADIC ) {
-    _Watchdog_Per_CPU_remove_relative( &api->Sporadic_timer );
-  }
-
-  api->Attributes.schedpolicy = policy;
-  api->Attributes.schedparam  = *param;
-
-  the_thread->budget_algorithm = budget_algorithm;
-  the_thread->budget_callout   = budget_callout;
-
-  switch ( policy ) {
-    case SCHED_OTHER:
-    case SCHED_FIFO:
-    case SCHED_RR:
-      the_thread->cpu_time_budget =
-        rtems_configuration_get_ticks_per_timeslice();
-      new_priority = _POSIX_Priority_To_core(
-        api->Attributes.schedparam.sched_priority
-      );
-      break;
-  }
-
-  _Thread_State_release( the_thread, &lock_context );
-
-  switch ( policy ) {
-    case SCHED_OTHER:
-    case SCHED_FIFO:
-    case SCHED_RR:
-      _Thread_Set_priority( the_thread, new_priority, &unused, false );
-      break;
-
-    case SCHED_SPORADIC:
-      _POSIX_Threads_Sporadic_budget_TSR( &api->Sporadic_timer );
-      break;
-  }
+  _Thread_Change_priority(
+    the_thread,
+    0,
+    &context,
+    _POSIX_Set_sched_param_filter,
+    false
+  );
 
   _Thread_Dispatch_enable( cpu_self );
-  return 0;
+  return context.error;
 }
Index: cpukit/posix/src/pthreadsetschedprio.c
===================================================================
--- cpukit/posix/src/pthreadsetschedprio.c	(revision 6bab009a61ae9ca7f7ac76140f8f13fbaab784c6)
+++ cpukit/posix/src/pthreadsetschedprio.c	(revision eec08efc9048111f47f42142c30a92683bf6756c)
@@ -18,18 +18,56 @@
 #include <rtems/score/threadimpl.h>
 
-int pthread_setschedprio( pthread_t thread, int prio )
+typedef struct {
+  int prio;
+  int error;
+} POSIX_Set_sched_prio_context;
+
+static bool _POSIX_Set_sched_prio_filter(
+  Thread_Control   *the_thread,
+  Priority_Control *new_priority_p,
+  void             *arg
+)
 {
-  Thread_Control    *the_thread;
-  Per_CPU_Control   *cpu_self;
-  POSIX_API_Control *api;
-  Priority_Control   unused;
-  ISR_lock_Context   lock_context;
-  Priority_Control   new_priority;
+  POSIX_Set_sched_prio_context *context;
+  int                           prio;
+  POSIX_API_Control            *api;
+  Priority_Control              current_priority;
+  Priority_Control              new_priority;
+
+  context = arg;
+  prio = context->prio;
 
   if ( !_POSIX_Priority_Is_valid( prio ) ) {
-    return EINVAL;
+    context->error = EINVAL;
+    return false;
   }
 
   new_priority = _POSIX_Priority_To_core( prio );
+  *new_priority_p = new_priority;
+
+  current_priority = the_thread->current_priority;
+  the_thread->real_priority = new_priority;
+
+  api = the_thread->API_Extensions[ THREAD_API_POSIX ];
+
+  api->Sporadic.high_priority = new_priority;
+
+  if ( api->Sporadic.low_priority < new_priority ) {
+    api->Sporadic.low_priority  = new_priority;
+  }
+
+  context->error = 0;
+  return _Thread_Priority_less_than( current_priority, new_priority )
+    || !_Thread_Owns_resources( the_thread );
+}
+
+int pthread_setschedprio( pthread_t thread, int prio )
+{
+  Thread_Control               *the_thread;
+  Per_CPU_Control              *cpu_self;
+  POSIX_Set_sched_prio_context  context;
+  ISR_lock_Context              lock_context;
+
+  context.prio = prio;
 
   the_thread = _Thread_Get( thread, &lock_context );
@@ -39,15 +77,16 @@
   }
 
-  api = the_thread->API_Extensions[ THREAD_API_POSIX ];
+  cpu_self = _Thread_Dispatch_disable_critical( &lock_context );
+  _ISR_lock_ISR_enable( &lock_context );
 
-  cpu_self = _Thread_Dispatch_disable_critical( &lock_context );
-
-  _Thread_State_acquire_critical( the_thread, &lock_context );
-  api->Attributes.schedparam.sched_priority = prio;
-  _Thread_State_release( the_thread, &lock_context );
-
-  _Thread_Set_priority( the_thread, new_priority, &unused, true );
+  _Thread_Change_priority(
+    the_thread,
+    0,
+    &context,
+    _POSIX_Set_sched_prio_filter,
+    true
+  );
 
   _Thread_Dispatch_enable( cpu_self );
-  return 0;
+  return context.error;
 }
Index: cpukit/score/include/rtems/score/thread.h
===================================================================
--- cpukit/score/include/rtems/score/thread.h	(revision 6bab009a61ae9ca7f7ac76140f8f13fbaab784c6)
+++ cpukit/score/include/rtems/score/thread.h	(revision eec08efc9048111f47f42142c30a92683bf6756c)
@@ -658,4 +658,5 @@
  *
  * The thread lock protects the following thread variables
+ *  - POSIX_API_Control::Attributes,
  *  - Thread_Control::current_priority,
  *  - Thread_Control::Wait::queue, and
@@ -711,5 +712,4 @@
    * the following fields
    *
-   * - POSIX_API_Control::Attributes,
    * - RTEMS_API_Control::Signal,
    * - Thread_Control::budget_algorithm,
