diff options
author | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2007-03-29 13:29:29 +0000 |
---|---|---|
committer | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2007-03-29 13:29:29 +0000 |
commit | 6b86f2907f7614b10e2c55f82f1b3f334c8d90a5 (patch) | |
tree | cbf2fbd8bc6a2b0fff095f75058bc76231c070dd /nuttx | |
parent | 34b0c9c8f5872806fa0cbcbd8c20b1d9c6dfebd4 (diff) | |
download | px4-nuttx-6b86f2907f7614b10e2c55f82f1b3f334c8d90a5.tar.gz px4-nuttx-6b86f2907f7614b10e2c55f82f1b3f334c8d90a5.tar.bz2 px4-nuttx-6b86f2907f7614b10e2c55f82f1b3f334c8d90a5.zip |
Block signals while pthread exits.
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@170 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'nuttx')
-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); |