Ticket #1582: threadevalmode.diff

File threadevalmode.diff, 2.7 KB (added by Gedare Bloom, on 06/21/10 at 20:11:37)

Patch to make _Thread_Evaluate_mode an inline function.

  • Makefile.am

    RCS file: /usr1/CVS/rtems/cpukit/score/Makefile.am,v
    retrieving revision 1.81
    diff -u -p -r1.81 Makefile.am
    libscore_a_SOURCES += src/pheapallocate. 
    141141## THREAD_C_FILES
    142142libscore_a_SOURCES += src/thread.c src/threadchangepriority.c \
    143143    src/threadclearstate.c src/threadclose.c src/threadcreateidle.c \
    144     src/threaddelayended.c src/threaddispatch.c src/threadevaluatemode.c \
     144    src/threaddelayended.c src/threaddispatch.c \
    145145    src/threadget.c src/threadhandler.c src/threadinitialize.c \
    146146    src/threadloadenv.c src/threadready.c src/threadresettimeslice.c \
    147147    src/threadreset.c src/threadrestart.c src/threadresume.c \
  • include/rtems/score/thread.h

    RCS file: /usr1/CVS/rtems/cpukit/score/include/rtems/score/thread.h,v
    retrieving revision 1.93
    diff -u -p -r1.93 thread.h
    void _Thread_Resume( 
    759759  bool              force
    760760);
    761761
    762 /**
    763  *  This routine evaluates the current scheduling information for the
    764  *  system and determines if a context switch is required.  This
    765  *  is usually called after changing an execution mode such as preemptability
    766  *  for a thread.
    767  */
    768 bool _Thread_Evaluate_mode( void );
    769 
    770762#if (CPU_PROVIDES_IDLE_THREAD_BODY == FALSE)
    771763/**
    772764 *  This routine is the body of the system idle thread.
  • inline/rtems/score/thread.inl

    RCS file: /usr1/CVS/rtems/cpukit/score/inline/rtems/score/thread.inl,v
    retrieving revision 1.39
    diff -u -p -r1.39 thread.inl
    RTEMS_INLINE_ROUTINE void _Thread_Set_li 
    332332  _Thread_libc_reent = libc_reent;
    333333}
    334334
     335/**
     336 *  This routine evaluates the current scheduling information for the
     337 *  system and determines if a context switch is required.  This
     338 *  is usually called after changing an execution mode such as preemptability
     339 *  for a thread.
     340 */
     341RTEMS_INLINE_ROUTINE bool _Thread_Evaluate_mode( void )
     342{
     343  Thread_Control     *executing;
     344
     345  executing = _Thread_Executing;
     346
     347  if ( !_States_Is_ready( executing->current_state ) ||
     348       ( !_Thread_Is_heir( executing ) && executing->is_preemptible ) ) {
     349    _Context_Switch_necessary = true;
     350    return true;
     351  }
     352
     353  return false;
     354}
     355
    335356/**@}*/
    336357
    337358#endif