mirror of
https://gitlab.rtems.org/rtems/rtos/rtems.git
synced 2026-09-20 22:55:36 +08:00
smp: Support ASR path in rtems_task_mode()
This commit is contained in:
@@ -32,11 +32,25 @@ static void _RTEMS_Tasks_Dispatch_if_necessary(
|
||||
if ( _Thread_Dispatch_is_enabled() ) {
|
||||
bool dispatch_necessary = needs_asr_dispatching;
|
||||
|
||||
/*
|
||||
* FIXME: This locking approach is brittle. It only works since the
|
||||
* current simple SMP scheduler has no support for the non-preempt mode.
|
||||
*/
|
||||
#if defined( RTEMS_SMP )
|
||||
ISR_Level level;
|
||||
|
||||
_ISR_Disable( level );
|
||||
#endif
|
||||
|
||||
if ( !_Thread_Is_heir( executing ) && executing->is_preemptible ) {
|
||||
dispatch_necessary = true;
|
||||
_Thread_Dispatch_necessary = dispatch_necessary;
|
||||
}
|
||||
|
||||
#if defined( RTEMS_SMP )
|
||||
_ISR_Enable( level );
|
||||
#endif
|
||||
|
||||
if ( dispatch_necessary ) {
|
||||
_Thread_Dispatch();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user