From 9b6e5f22f95b4fd7fa108ab061dc548f163c735e Mon Sep 17 00:00:00 2001 From: ligd Date: Mon, 12 Jun 2023 13:25:49 +0800 Subject: [PATCH] assert: thread assert don't interrupt by IRQ Signed-off-by: ligd --- sched/misc/assert.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/sched/misc/assert.c b/sched/misc/assert.c index 357ad7b8149..8c29e471ebf 100644 --- a/sched/misc/assert.c +++ b/sched/misc/assert.c @@ -555,6 +555,9 @@ void _assert(FAR const char *filename, int linenum, FAR struct tcb_s *rtcb = running_task(); struct utsname name; bool fatal = true; + int flags; + + flags = enter_critical_section(); /* try to save current context if regs is null */ @@ -676,4 +679,6 @@ void _assert(FAR const char *filename, int linenum, } #endif } + + leave_critical_section(flags); }