From 783edcd0beb03514ca4999a13543183a69a494c2 Mon Sep 17 00:00:00 2001 From: x_xiny <1301913191@qq.com> Date: Fri, 14 Jan 2022 16:35:38 +0800 Subject: [PATCH] =?UTF-8?q?=20fix:=20L1-liteos-tdd=E6=B5=8B=E8=AF=95liteos?= =?UTF-8?q?=5Fa=5Fprocess=5Funittest.bin,liteos=5Fa=5Fsecurity=5Fvid=5Funi?= =?UTF-8?q?ttest.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.删除内核中不必要的打印 Signed-off-by: xuiny Change-Id: I980c523b41dbc1f5a7f64a74a387081fdab25449 --- porting/liteos_a/user/src/exit/exit.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/porting/liteos_a/user/src/exit/exit.c b/porting/liteos_a/user/src/exit/exit.c index 5001bf12..f0df0d47 100644 --- a/porting/liteos_a/user/src/exit/exit.c +++ b/porting/liteos_a/user/src/exit/exit.c @@ -2,8 +2,11 @@ #include #include #include +#include #include "libc.h" +pthread_mutex_t __exit_mutex = PTHREAD_MUTEX_INITIALIZER; + static void dummy() { } @@ -29,9 +32,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); __funcs_on_exit(); __libc_exit_fini(); -- GitLab