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 <zhangyuan29@xiaomi.com>
This commit is contained in:
zhangyuan29 2024-10-08 13:39:03 +08:00 • committed by Xiang Xiao
parent 99b364c880
commit 651a5e6afa

View file

@ -30,10 +30,10 @@
#include <stdint.h>
#include <stdlib.h>
#include <string.h>
#include <pthread.h>
#include <signal.h>
#include <assert.h>
#include <nuttx/pthread.h>
#include <nuttx/sched.h>
#include <nuttx/spinlock.h>
#include <nuttx/signal.h>
@ -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