Block signals while pthread exits.
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@170 42af7a65-404d-4744-a932-0658087f49c3
This commit is contained in:
parent
0c2ff4a47c
commit
54339607da
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user