sim/posix/backtrace: process host backtrace with critical section
backtrace() is not a signal safe Signed-off-by: chao an <anchao@xiaomi.com>
This commit is contained in:
parent
6417ca79ad
commit
150e5a1a0f
@ -94,7 +94,13 @@ int host_backtrace(void** array, int size)
|
|||||||
#ifdef CONFIG_WINDOWS_CYGWIN
|
#ifdef CONFIG_WINDOWS_CYGWIN
|
||||||
return 0;
|
return 0;
|
||||||
#else
|
#else
|
||||||
return backtrace(array, size);
|
uint64_t flags = up_irq_save();
|
||||||
|
int ret;
|
||||||
|
|
||||||
|
ret = backtrace(array, size);
|
||||||
|
|
||||||
|
up_irq_restore(flags);
|
||||||
|
return ret;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user