From c9de2b44673c918804774925a8ca43451071f0d9 Mon Sep 17 00:00:00 2001 From: x_xiny <1301913191@qq.com> Date: Thu, 13 Jan 2022 21:46:04 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20L1-liteos-tdd=E6=B5=8B=E8=AF=95liteos=5F?= =?UTF-8?q?a=5Fprocess=5Funittest.bin,liteos=5Fa=5Fsecurity=5Fvid=5Funitte?= =?UTF-8?q?st.bin=E5=92=8Cliteos=5Fa=5Ftime=5Fclock=5Funittest.bin?= =?UTF-8?q?=E6=A8=A1=E5=9D=97=E7=94=A8=E4=BE=8Bun?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 【背景】L1-liteos-tdd测试liteos_a_process_unittest.bin,liteos_a_security_vid_unittest.bin和liteos_a_time_clock_unittest.bin模块用例un 【修改方案】 1.暂时将musl中的exit()接口中的原子操作改为使用mutex方式实现 2.删除内核中不必要的打印 re #I4K9A5 Signed-off-by: xuiny Change-Id: I1a0e41febe69e6e25efb53bdf8d070824ad9b9fe --- porting/liteos_a/user_debug/src/exit/exit.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/porting/liteos_a/user_debug/src/exit/exit.c b/porting/liteos_a/user_debug/src/exit/exit.c index 945da520..4c0f48e4 100644 --- a/porting/liteos_a/user_debug/src/exit/exit.c +++ b/porting/liteos_a/user_debug/src/exit/exit.c @@ -4,11 +4,13 @@ #include #include #include +#include #include "libc.h" extern bool g_enable_check; extern void mem_check_deinit(void); extern void clean_recycle_list(bool clean_all); +pthread_mutex_t __exit_mutex = PTHREAD_MUTEX_INITIALIZER; static void dummy() { @@ -35,9 +37,9 @@ weak_alias(libc_exit_fini, __libc_exit_fini); _Noreturn void exit(int code) { sigset_t set; - if (a_cas(&libc.exit, 0, 1) != 0) { - return; - } + + pthread_mutex_lock(&__exit_mutex); + __block_app_sigs(&set); if (g_enable_check) { check_leak(); -- GitLab