assert: Stop scheduling when an assert is invoked to prevent running task change

Signed-off-by: zhangyuan21 <zhangyuan21@xiaomi.com>
This commit is contained in:
zhangyuan21 2023-06-15 10:34:41 +08:00 committed by Xiang Xiao
parent 9b6e5f22f9
commit ef48dec9f9

View File

@ -559,6 +559,8 @@ void _assert(FAR const char *filename, int linenum,
flags = enter_critical_section();
sched_lock();
/* try to save current context if regs is null */
if (regs == NULL)
@ -680,5 +682,7 @@ void _assert(FAR const char *filename, int linenum,
#endif
}
sched_unlock();
leave_critical_section(flags);
}