summaryrefslogtreecommitdiff
path: root/nuttx/sched/task_setup.c
diff options
context:
space:
mode:
Diffstat (limited to 'nuttx/sched/task_setup.c')
-rw-r--r--nuttx/sched/task_setup.c11
1 files 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 */