From 54339607da631b8b28019641ab2aa9232eb60c61 Mon Sep 17 00:00:00 2001 From: patacongo Date: Thu, 29 Mar 2007 13:29:29 +0000 Subject: [PATCH] Block signals while pthread exits. git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@170 42af7a65-404d-4744-a932-0658087f49c3 --- sched/pthread_exit.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/sched/pthread_exit.c b/sched/pthread_exit.c index 087076ac3d..59dea63e76 100644 --- a/sched/pthread_exit.c +++ b/sched/pthread_exit.c @@ -40,6 +40,7 @@ #include #include #include +#include #include #include #include @@ -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);