diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2013-07-29 15:01:55 +0200 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2013-07-30 09:53:25 +0200 |
commit | 3f317e9033d45ffb8939e60b4105d4980046ab59 (patch) | |
tree | aac107ce1de9a7ca32fe8917bf3f69b42371ac21 | |
parent | posix: Simplify pthread_kill() (diff) | |
download | rtems-3f317e9033d45ffb8939e60b4105d4980046ab59.tar.bz2 |
score: Move _Thread_Dispatch_if_necessary()
Rename to _RTEMS_Tasks_Dispatch_if_necessary().
-rw-r--r-- | cpukit/rtems/src/taskmode.c | 21 | ||||
-rw-r--r-- | cpukit/score/include/rtems/score/threadimpl.h | 26 |
2 files changed, 20 insertions, 27 deletions
diff --git a/cpukit/rtems/src/taskmode.c b/cpukit/rtems/src/taskmode.c index bbe59bb6df..3d6dee8105 100644 --- a/cpukit/rtems/src/taskmode.c +++ b/cpukit/rtems/src/taskmode.c @@ -24,6 +24,25 @@ #include <rtems/score/threadimpl.h> #include <rtems/config.h> +static void _RTEMS_Tasks_Dispatch_if_necessary( + Thread_Control *executing, + bool needs_asr_dispatching +) +{ + if ( _Thread_Dispatch_is_enabled() ) { + bool dispatch_necessary = needs_asr_dispatching; + + if ( !_Thread_Is_heir( executing ) && executing->is_preemptible ) { + dispatch_necessary = true; + _Thread_Dispatch_necessary = dispatch_necessary; + } + + if ( dispatch_necessary ) { + _Thread_Dispatch(); + } + } +} + rtems_status_code rtems_task_mode( rtems_mode mode_set, rtems_mode mask, @@ -101,7 +120,7 @@ rtems_status_code rtems_task_mode( } } - _Thread_Dispatch_if_necessary( executing, needs_asr_dispatching ); + _RTEMS_Tasks_Dispatch_if_necessary( executing, needs_asr_dispatching ); return RTEMS_SUCCESSFUL; } diff --git a/cpukit/score/include/rtems/score/threadimpl.h b/cpukit/score/include/rtems/score/threadimpl.h index d50980d4db..7a48c2684b 100644 --- a/cpukit/score/include/rtems/score/threadimpl.h +++ b/cpukit/score/include/rtems/score/threadimpl.h @@ -632,32 +632,6 @@ RTEMS_INLINE_ROUTINE uint32_t _Thread_Get_global_exit_status( void ) return idle->Wait.return_code; } -/** - * @brief Issues a thread dispatch if necessary. - * - * @param[in] executing The executing thread. - * @param[in] needs_asr_dispatching Indicates whether or not the API - * level signals are pending and a dispatch is necessary. - */ -RTEMS_INLINE_ROUTINE void _Thread_Dispatch_if_necessary( - Thread_Control *executing, - bool needs_asr_dispatching -) -{ - if ( _Thread_Dispatch_is_enabled() ) { - bool dispatch_necessary = needs_asr_dispatching; - - if ( !_Thread_Is_heir( executing ) && executing->is_preemptible ) { - dispatch_necessary = true; - _Thread_Dispatch_necessary = dispatch_necessary; - } - - if ( dispatch_necessary ) { - _Thread_Dispatch(); - } - } -} - RTEMS_INLINE_ROUTINE void _Thread_Signal_notification( Thread_Control *thread ) { if ( _ISR_Is_in_progress() && _Thread_Is_executing( thread ) ) |