Changeset f926b34 in rtems


Ignore:
Timestamp:
Mar 8, 1997, 3:51:55 AM (25 years ago)
Author:
Joel Sherrill <joel.sherrill@…>
Branches:
4.10, 4.11, 4.8, 4.9, 5, master
Children:
133fb0e5
Parents:
dab057a
Message:

Modified calls to _Thread_Change_priority to take a third argument. The new
argument indicates whether the task is to be placed at the head or tail of
its priority fifo when it is lowering its own priority. POSIX normally
follows the RTEMS API conventions but GNAT expects that all lowering of
a task's priority by the task itself will result in being placed at the
head of the priority FIFO. Normally, this would only occur as the result
of lose of inherited priority.

Files:
9 edited

Legend:

Unmodified
Added
Removed
  • c/src/exec/posix/src/pthread.c

    rdab057a rf926b34  
    7878  if ( the_thread->resource_count == 0 ||
    7979       the_thread->current_priority > new_priority )
    80     _Thread_Change_priority( the_thread, new_priority );
     80    _Thread_Change_priority( the_thread, new_priority, TRUE );
    8181
    8282  ticks = _POSIX_Timespec_to_interval( &api->schedparam.ss_replenish_period );
     
    115115 if ( the_thread->resource_count == 0 ||
    116116      the_thread->current_priority > new_priority )
    117     _Thread_Change_priority( the_thread, new_priority );
     117    _Thread_Change_priority( the_thread, new_priority, TRUE );
    118118}
    119119
     
    657657            _POSIX_Priority_To_core( api->schedparam.sched_priority );
    658658
    659           _Thread_Change_priority( the_thread, the_thread->real_priority );
     659          _Thread_Change_priority(
     660             the_thread,
     661             the_thread->real_priority,
     662             TRUE
     663          );
    660664          break;
    661665 
  • c/src/exec/score/headers/thread.h

    rdab057a rf926b34  
    562562void _Thread_Change_priority (
    563563  Thread_Control   *the_thread,
    564   Priority_Control  new_priority
     564  Priority_Control  new_priority,
     565  boolean           prepend_it
    565566);
    566567
  • c/src/exec/score/include/rtems/score/thread.h

    rdab057a rf926b34  
    562562void _Thread_Change_priority (
    563563  Thread_Control   *the_thread,
    564   Priority_Control  new_priority
     564  Priority_Control  new_priority,
     565  boolean           prepend_it
    565566);
    566567
  • c/src/exec/score/src/coremutex.c

    rdab057a rf926b34  
    143143        _Thread_Change_priority(
    144144          the_mutex->holder,
    145           the_mutex->Attributes.priority_ceiling
     145          the_mutex->Attributes.priority_ceiling,
     146          FALSE
    146147        );
    147148      }
     
    181182        _Thread_Change_priority(
    182183          the_mutex->holder,
    183           executing->current_priority
     184          executing->current_priority,
     185          FALSE
    184186        );
    185187      }
     
    200202          _Thread_Change_priority(
    201203            executing,
    202             the_mutex->Attributes.priority_ceiling
     204            the_mutex->Attributes.priority_ceiling,
     205            FALSE
    203206          );
    204207        };
     
    263266    case CORE_MUTEX_DISCIPLINES_PRIORITY_CEILING:
    264267    case CORE_MUTEX_DISCIPLINES_PRIORITY_INHERIT:
    265       if ( executing->resource_count == 0 &&
    266            executing->real_priority !=
    267            executing->current_priority ) {
    268          _Thread_Change_priority( executing, executing->real_priority );
     268      if ( executing->resource_count == 0 &&
     269           executing->real_priority != executing->current_priority ) {
     270         _Thread_Change_priority( executing, executing->real_priority, TRUE );
    269271      }
    270272      break;
  • c/src/exec/score/src/thread.c

    rdab057a rf926b34  
    12071207 *    the_thread   - pointer to thread control block
    12081208 *    new_priority - ultimate priority
     1209 *    prepend_it   - TRUE if the thread should be prepended to the chain
    12091210 *
    12101211 *  Output parameters:  NONE
     
    12171218void _Thread_Change_priority(
    12181219  Thread_Control   *the_thread,
    1219   Priority_Control  new_priority
     1220  Priority_Control  new_priority,
     1221  boolean           prepend_it
    12201222)
    12211223{
    12221224  ISR_Level level;
    1223 
     1225  /* boolean   do_prepend = FALSE; */
     1226
     1227  /*
     1228   *  If this is a case where prepending the task to its priority is
     1229   *  potentially desired, then we need to consider whether to do it.
     1230   *  This usually occurs when a task lowers its priority implcitly as
     1231   *  the result of losing inherited priority.  Normal explicit priority
     1232   *  change calls (e.g. rtems_task_set_priority) should always do an
     1233   *  append not a prepend.
     1234   */
     1235 
     1236  /*
     1237   *  Techically, the prepend should conditional on the thread lowering
     1238   *  its priority but that does allow cxd2004 of the acvc 2.0.1 to
     1239   *  pass with rtems 4.0.0.  This should change when gnat redoes its
     1240   *  priority scheme.
     1241   */
     1242/*
     1243  if ( prepend_it &&
     1244       _Thread_Is_executing( the_thread ) &&
     1245       new_priority >= the_thread->current_priority )
     1246    prepend_it = TRUE;
     1247*/
     1248                 
    12241249  _Thread_Set_transient( the_thread );
    12251250
     
    12381263
    12391264  _Priority_Add_to_bit_map( &the_thread->Priority_map );
    1240   _Chain_Append_unprotected( the_thread->ready, &the_thread->Object.Node );
     1265  if ( prepend_it )
     1266    _Chain_Prepend_unprotected( the_thread->ready, &the_thread->Object.Node );
     1267  else
     1268    _Chain_Append_unprotected( the_thread->ready, &the_thread->Object.Node );
    12411269
    12421270  _ISR_Flash( level );
     
    12471275       _Thread_Executing->is_preemptible )
    12481276    _Context_Switch_necessary = TRUE;
    1249 
    12501277  _ISR_Enable( level );
    12511278}
  • cpukit/posix/src/pthread.c

    rdab057a rf926b34  
    7878  if ( the_thread->resource_count == 0 ||
    7979       the_thread->current_priority > new_priority )
    80     _Thread_Change_priority( the_thread, new_priority );
     80    _Thread_Change_priority( the_thread, new_priority, TRUE );
    8181
    8282  ticks = _POSIX_Timespec_to_interval( &api->schedparam.ss_replenish_period );
     
    115115 if ( the_thread->resource_count == 0 ||
    116116      the_thread->current_priority > new_priority )
    117     _Thread_Change_priority( the_thread, new_priority );
     117    _Thread_Change_priority( the_thread, new_priority, TRUE );
    118118}
    119119
     
    657657            _POSIX_Priority_To_core( api->schedparam.sched_priority );
    658658
    659           _Thread_Change_priority( the_thread, the_thread->real_priority );
     659          _Thread_Change_priority(
     660             the_thread,
     661             the_thread->real_priority,
     662             TRUE
     663          );
    660664          break;
    661665 
  • cpukit/score/include/rtems/score/thread.h

    rdab057a rf926b34  
    562562void _Thread_Change_priority (
    563563  Thread_Control   *the_thread,
    564   Priority_Control  new_priority
     564  Priority_Control  new_priority,
     565  boolean           prepend_it
    565566);
    566567
  • cpukit/score/src/coremutex.c

    rdab057a rf926b34  
    143143        _Thread_Change_priority(
    144144          the_mutex->holder,
    145           the_mutex->Attributes.priority_ceiling
     145          the_mutex->Attributes.priority_ceiling,
     146          FALSE
    146147        );
    147148      }
     
    181182        _Thread_Change_priority(
    182183          the_mutex->holder,
    183           executing->current_priority
     184          executing->current_priority,
     185          FALSE
    184186        );
    185187      }
     
    200202          _Thread_Change_priority(
    201203            executing,
    202             the_mutex->Attributes.priority_ceiling
     204            the_mutex->Attributes.priority_ceiling,
     205            FALSE
    203206          );
    204207        };
     
    263266    case CORE_MUTEX_DISCIPLINES_PRIORITY_CEILING:
    264267    case CORE_MUTEX_DISCIPLINES_PRIORITY_INHERIT:
    265       if ( executing->resource_count == 0 &&
    266            executing->real_priority !=
    267            executing->current_priority ) {
    268          _Thread_Change_priority( executing, executing->real_priority );
     268      if ( executing->resource_count == 0 &&
     269           executing->real_priority != executing->current_priority ) {
     270         _Thread_Change_priority( executing, executing->real_priority, TRUE );
    269271      }
    270272      break;
  • cpukit/score/src/thread.c

    rdab057a rf926b34  
    12071207 *    the_thread   - pointer to thread control block
    12081208 *    new_priority - ultimate priority
     1209 *    prepend_it   - TRUE if the thread should be prepended to the chain
    12091210 *
    12101211 *  Output parameters:  NONE
     
    12171218void _Thread_Change_priority(
    12181219  Thread_Control   *the_thread,
    1219   Priority_Control  new_priority
     1220  Priority_Control  new_priority,
     1221  boolean           prepend_it
    12201222)
    12211223{
    12221224  ISR_Level level;
    1223 
     1225  /* boolean   do_prepend = FALSE; */
     1226
     1227  /*
     1228   *  If this is a case where prepending the task to its priority is
     1229   *  potentially desired, then we need to consider whether to do it.
     1230   *  This usually occurs when a task lowers its priority implcitly as
     1231   *  the result of losing inherited priority.  Normal explicit priority
     1232   *  change calls (e.g. rtems_task_set_priority) should always do an
     1233   *  append not a prepend.
     1234   */
     1235 
     1236  /*
     1237   *  Techically, the prepend should conditional on the thread lowering
     1238   *  its priority but that does allow cxd2004 of the acvc 2.0.1 to
     1239   *  pass with rtems 4.0.0.  This should change when gnat redoes its
     1240   *  priority scheme.
     1241   */
     1242/*
     1243  if ( prepend_it &&
     1244       _Thread_Is_executing( the_thread ) &&
     1245       new_priority >= the_thread->current_priority )
     1246    prepend_it = TRUE;
     1247*/
     1248                 
    12241249  _Thread_Set_transient( the_thread );
    12251250
     
    12381263
    12391264  _Priority_Add_to_bit_map( &the_thread->Priority_map );
    1240   _Chain_Append_unprotected( the_thread->ready, &the_thread->Object.Node );
     1265  if ( prepend_it )
     1266    _Chain_Prepend_unprotected( the_thread->ready, &the_thread->Object.Node );
     1267  else
     1268    _Chain_Append_unprotected( the_thread->ready, &the_thread->Object.Node );
    12411269
    12421270  _ISR_Flash( level );
     
    12471275       _Thread_Executing->is_preemptible )
    12481276    _Context_Switch_necessary = TRUE;
    1249 
    12501277  _ISR_Enable( level );
    12511278}
Note: See TracChangeset for help on using the changeset viewer.