diff options
author | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2007-03-29 13:34:37 +0000 |
---|---|---|
committer | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2007-03-29 13:34:37 +0000 |
commit | c34b8df9eb4095e6a22260e6677751db319fe33c (patch) | |
tree | 751602ae35559e01e3b4bc78e5c3c09d0b829c1e | |
parent | 70dec469f5023415a348e3267e53b4eff1e2cb37 (diff) | |
download | px4-nuttx-c34b8df9eb4095e6a22260e6677751db319fe33c.tar.gz px4-nuttx-c34b8df9eb4095e6a22260e6677751db319fe33c.tar.bz2 px4-nuttx-c34b8df9eb4095e6a22260e6677751db319fe33c.zip |
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: svn://svn.code.sf.net/p/nuttx/code/trunk@173 42af7a65-404d-4744-a932-0658087f49c3
-rw-r--r-- | nuttx/sched/task_setup.c | 11 |
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 */ |