diff options
author | Joel Sherrill <joel.sherrill@OARcorp.com> | 2010-06-24 22:40:32 +0000 |
---|---|---|
committer | Joel Sherrill <joel.sherrill@OARcorp.com> | 2010-06-24 22:40:32 +0000 |
commit | 569b3f41413f9b7b1b43cce256f4b8594dbeabdf (patch) | |
tree | 6d4f5be119a7dcdbe17324926115b616ea4bf9b2 /cpukit/score/inline/rtems/score/thread.inl | |
parent | 2010-06-24 Joel Sherrill <joel.sherrilL@OARcorp.com> (diff) | |
download | rtems-569b3f41413f9b7b1b43cce256f4b8594dbeabdf.tar.bz2 |
2010-06-24 Gedare Bloom <giddyup44@yahoo.com>
PR 1589/cpukit
* score/Makefile.am, score/include/rtems/score/thread.h,
score/inline/rtems/score/thread.inl: Make _Thread_Evaluate_mode() an
inline method. It is only used in one place and relatively simple.
* score/src/threadevaluatemode.c: Removed.
Diffstat (limited to 'cpukit/score/inline/rtems/score/thread.inl')
-rw-r--r-- | cpukit/score/inline/rtems/score/thread.inl | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/cpukit/score/inline/rtems/score/thread.inl b/cpukit/score/inline/rtems/score/thread.inl index 9e9b50d8b3..40735aff19 100644 --- a/cpukit/score/inline/rtems/score/thread.inl +++ b/cpukit/score/inline/rtems/score/thread.inl @@ -332,6 +332,27 @@ RTEMS_INLINE_ROUTINE void _Thread_Set_libc_reent ( _Thread_libc_reent = libc_reent; } +/** + * This routine evaluates the current scheduling information for the + * system and determines if a context switch is required. This + * is usually called after changing an execution mode such as preemptability + * for a thread. + */ +RTEMS_INLINE_ROUTINE bool _Thread_Evaluate_mode( void ) +{ + Thread_Control *executing; + + executing = _Thread_Executing; + + if ( !_States_Is_ready( executing->current_state ) || + ( !_Thread_Is_heir( executing ) && executing->is_preemptible ) ) { + _Context_Switch_necessary = true; + return true; + } + + return false; +} + /**@}*/ #endif |