From 90d6e4a7eb20b07ca5ba3dd7edc240e16be24496 Mon Sep 17 00:00:00 2001 From: patacongo Date: Thu, 29 Mar 2007 13:34:37 +0000 Subject: [PATCH] Signal mask is now inherited by both child tasks and threads; this has the side-effect of changing the initia l state of all signals from blocked to unblocked. git-svn-id: https://nuttx.svn.sourceforge.net/svnroot/nuttx/trunk@173 7fd9a85b-ad96-42d3-883c-3090e2eb8679 --- nuttx/sched/task_setup.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/nuttx/sched/task_setup.c b/nuttx/sched/task_setup.c index fb1c0b932..52596dc7c 100644 --- a/nuttx/sched/task_setup.c +++ b/nuttx/sched/task_setup.c @@ -187,11 +187,18 @@ STATUS task_schedsetup(FAR _TCB *tcb, int priority, tcb->start = start; tcb->entry.main = main; - /* Initialize other (non-zero) elements of the TCB */ + /* exec() and pthread_create() inherit the signal mask of the + * parent thread. I suppose that task_create() should as well. + */ #ifndef CONFIG_DISABLE_SIGNALS - tcb->sigprocmask = ALL_SIGNAL_SET; + (void)sigprocmask(SIG_SETMASK, NULL, &tcb->sigprocmask); #endif + + /* Initialize the task state. It does not get a valid state + * until it is activated. + */ + tcb->task_state = TSTATE_TASK_INVALID; /* Initialize the processor-specific portion of the TCB */