mirror of
https://github.com/RT-Thread/rt-thread.git
synced 2025-10-19 20:43:43 +08:00
[kernel] fixup of data racing accessing percpu objects (#8475)
Signed-off-by: Shell <smokewood@qq.com>
This commit is contained in:
@@ -835,6 +835,16 @@ while (0)
|
||||
#define RT_DEBUG_SCHEDULER_AVAILABLE(need_check)
|
||||
#endif /* RT_DEBUGING_CONTEXT */
|
||||
|
||||
rt_inline rt_bool_t rt_in_thread_context(void)
|
||||
{
|
||||
return rt_thread_self() != RT_NULL && rt_interrupt_get_nest() == 0;
|
||||
}
|
||||
|
||||
rt_inline rt_bool_t rt_scheduler_is_available(void)
|
||||
{
|
||||
return !rt_hw_interrupt_is_disabled() && rt_critical_level() == 0 && rt_in_thread_context();
|
||||
}
|
||||
|
||||
/**@}*/
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
Reference in New Issue
Block a user