Changeset 5c78940d in rtems


Ignore:
Timestamp:
Jun 12, 2013, 8:08:58 AM (6 years ago)
Author:
Sebastian Huber <sebastian.huber@…>
Branches:
4.11, master
Children:
edde99b
Parents:
49cdf40
git-author:
Sebastian Huber <sebastian.huber@…> (06/12/13 08:08:58)
git-committer:
Sebastian Huber <sebastian.huber@…> (06/14/13 14:26:07)
Message:

score: Add and use _Thread_Dispatch_if_necessary()

Delete _Thread_Evaluate_is_dispatch_needed().

Use _Thread_Dispatch_is_enabled() in rtems_task_mode() instead of the
system state to determine if a thread dispatch is allowed. Signales are
now delivered in rtems_task_mode() even if preemption is disabled. This
is in line with rtems_signal_send().

Location:
cpukit
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • cpukit/rtems/src/taskmode.c

    r49cdf40 r5c78940d  
    101101  }
    102102
    103   if ( _System_state_Is_up( _System_state_Get() ) ) {
    104      if (_Thread_Evaluate_is_dispatch_needed( needs_asr_dispatching ) )
    105       _Thread_Dispatch();
    106   }
     103  _Thread_Dispatch_if_necessary( executing, needs_asr_dispatching );
    107104
    108105  return RTEMS_SUCCESSFUL;
  • cpukit/score/inline/rtems/score/thread.inl

    r49cdf40 r5c78940d  
    224224
    225225/**
     226 * @brief Issues a thread dispatch if necessary.
     227 *
     228 * @param[in] executing The executing thread.
     229 * @param[in] needs_asr_dispatching Indicates whether or not the API
     230 *            level signals are pending and a dispatch is necessary.
     231 */
     232RTEMS_INLINE_ROUTINE void _Thread_Dispatch_if_necessary(
     233  Thread_Control *executing,
     234  bool            needs_asr_dispatching
     235)
     236{
     237  if ( _Thread_Dispatch_is_enabled() ) {
     238    bool dispatch_necessary = needs_asr_dispatching;
     239
     240    if ( !_Thread_Is_heir( executing ) && executing->is_preemptible ) {
     241      dispatch_necessary = true;
     242      _Thread_Dispatch_necessary = dispatch_necessary;
     243    }
     244
     245    if ( dispatch_necessary ) {
     246      _Thread_Dispatch();
     247    }
     248  }
     249}
     250
     251/**
    226252 * This routine returns the C library re-enterant pointer.
    227253 */
     
    243269}
    244270
    245 /**
    246  * This routine evaluates the current scheduling information for the
    247  * system and determines if a context switch is required.  This
    248  * is usually called after changing an execution mode such as preemptability
    249  * for a thread.
    250  *
    251  * @param[in] are_signals_pending specifies whether or not the API
    252  *            level signals are pending and a dispatch is needed.
    253  */
    254 RTEMS_INLINE_ROUTINE bool _Thread_Evaluate_is_dispatch_needed(
    255   bool are_signals_pending
    256 )
    257 {
    258   Thread_Control     *executing;
    259 
    260   executing = _Thread_Executing;
    261 
    262   if ( are_signals_pending ||
    263        (!_Thread_Is_heir( executing ) && executing->is_preemptible) ) {
    264     _Thread_Dispatch_necessary = true;
    265     return true;
    266   }
    267 
    268   return false;
    269 }
    270 
    271271/** @}*/
    272272
Note: See TracChangeset for help on using the changeset viewer.