mirror of
https://github.com/apache/nuttx.git
synced 2026-05-23 14:58:13 +08:00
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:
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user