diff options
Diffstat (limited to 'nuttx/sched')
-rw-r--r-- | nuttx/sched/pthread_exit.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/nuttx/sched/pthread_exit.c b/nuttx/sched/pthread_exit.c index 087076ac3..59dea63e7 100644 --- a/nuttx/sched/pthread_exit.c +++ b/nuttx/sched/pthread_exit.c @@ -40,6 +40,7 @@ #include <sys/types.h> #include <stdlib.h> #include <unistd.h> +#include <signal.h> #include <pthread.h> #include <errno.h> #include <debug.h> @@ -93,6 +94,17 @@ void pthread_exit(FAR void *exit_value) dbg("exit_value=%p\n", exit_value); + /* Block any signal actions that would awaken us while were + * are performing the JOIN handshake. + */ + +#ifndef CONFIG_DISABLE_SIGNALS + { + sigset_t set = ALL_SIGNAL_SET; + (void)sigprocmask(SIG_SETMASK, &set, NULL); + } +#endif + /* Complete pending join operations */ status = pthread_completejoin(getpid(), exit_value); |