Skip to content

Commit

Permalink
sched/signal: change pthread_exit to nx_pthread_exit
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
zyfeier committed Oct 8, 2024
1 parent 4e5a963 commit bb564b5
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions sched/signal/sig_default.c
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down Expand Up @@ -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 */

Expand All @@ -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
Expand Down

0 comments on commit bb564b5

Please sign in to comment.