smp: Support ASR path in rtems_task_mode()

This commit is contained in:
Sebastian Huber
2013-08-05 15:52:32 +02:00
parent 007bdc4f59
commit bfed5d5d15
+14
View File
@@ -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();
}