From bb564b5b858130c32f6a03566bfd8e190c3a02d3 Mon Sep 17 00:00:00 2001 From: zhangyuan29 Date: Tue, 8 Oct 2024 13:39:03 +0800 Subject: [PATCH] sched/signal: change pthread_exit to nx_pthread_exit In protected build, kernel cannot call usersapce interface. 1. change pthread_exit to nx_pthread_exit. 2. add kernel tls cleanup. Signed-off-by: zhangyuan29 --- sched/signal/sig_default.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/sched/signal/sig_default.c b/sched/signal/sig_default.c index 66c7c8ba96864..b129c60bebfb3 100644 --- a/sched/signal/sig_default.c +++ b/sched/signal/sig_default.c @@ -30,10 +30,10 @@ #include #include #include -#include #include #include +#include #include #include #include @@ -225,6 +225,8 @@ static void nxsig_abnormal_termination(int signo) group_kill_children(rtcb); #endif + tls_cleanup_popall(tls_get_info()); + #ifndef CONFIG_DISABLE_PTHREAD /* Check if the currently running task is actually a pthread */ @@ -235,7 +237,7 @@ static void nxsig_abnormal_termination(int signo) * REVISIT: This will not work if HAVE_GROUP_MEMBERS is not set. */ - pthread_exit(NULL); + nx_pthread_exit(NULL); } else #endif