未验证 提交 69e8c032 编写于 作者: B Bernard Xiong 提交者: GitHub

Merge pull request #3199 from BernardXiong/fix_signal_issue

[Kernel] Fix the signal issue when the context switch is triggered bu…
......@@ -384,7 +384,12 @@ void rt_schedule(void)
}
}
/* enable interrupt */
rt_hw_interrupt_enable(level);
#ifdef RT_USING_SIGNALS
/* check stat of thread for signal */
level = rt_hw_interrupt_disable();
if (current_thread->stat & RT_THREAD_STAT_SIGNAL_PENDING)
{
extern void rt_thread_handle_sig(rt_bool_t clean_state);
......@@ -400,9 +405,6 @@ void rt_schedule(void)
{
rt_hw_interrupt_enable(level);
}
#else
/* enable interrupt */
rt_hw_interrupt_enable(level);
#endif
__exit:
......@@ -487,7 +489,13 @@ void rt_schedule(void)
rt_hw_context_switch((rt_ubase_t)&from_thread->sp,
(rt_ubase_t)&to_thread->sp);
/* enable interrupt */
rt_hw_interrupt_enable(level);
#ifdef RT_USING_SIGNALS
/* check stat of thread for signal */
level = rt_hw_interrupt_disable();
if (rt_current_thread->stat & RT_THREAD_STAT_SIGNAL_PENDING)
{
extern void rt_thread_handle_sig(rt_bool_t clean_state);
......@@ -503,9 +511,6 @@ void rt_schedule(void)
{
rt_hw_interrupt_enable(level);
}
#else
/* enable interrupt */
rt_hw_interrupt_enable(level);
#endif
goto __exit;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册