summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2007-03-29 13:31:08 +0000
committerpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2007-03-29 13:31:08 +0000
commit8f1aaf4a5e18a726b1faac47a1e6a6c1aa4f9b23 (patch)
tree5b66f687fc40437d9c08c25bc7f5297f38318c32
parent6b86f2907f7614b10e2c55f82f1b3f334c8d90a5 (diff)
downloadnuttx-8f1aaf4a5e18a726b1faac47a1e6a6c1aa4f9b23.tar.gz
nuttx-8f1aaf4a5e18a726b1faac47a1e6a6c1aa4f9b23.tar.bz2
nuttx-8f1aaf4a5e18a726b1faac47a1e6a6c1aa4f9b23.zip
Don't allow signals to wake up blocked task if the signal is blocked.
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@171 42af7a65-404d-4744-a932-0658087f49c3
-rw-r--r--nuttx/sched/sig_received.c41
1 files changed, 21 insertions, 20 deletions
diff --git a/nuttx/sched/sig_received.c b/nuttx/sched/sig_received.c
index 6cdf1dd9f..5db0aa099 100644
--- a/nuttx/sched/sig_received.c
+++ b/nuttx/sched/sig_received.c
@@ -289,8 +289,8 @@ int sig_received(FAR _TCB *stcb, siginfo_t *info)
irqstate_t saved_state;
int ret = ERROR;
- dbg("sig_received: TCB=0x%08x signo=%d code=%d value=%d\n",
- stcb, info->si_signo, info->si_code, info->si_value.sival_int);
+ dbg("sig_received: TCB=0x%08x signo=%d code=%d value=%d mask=%08x\n",
+ stcb, info->si_signo, info->si_code, info->si_value.sival_int, stcb->sigprocmask);
if (stcb && info)
{
@@ -363,31 +363,32 @@ int sig_received(FAR _TCB *stcb, siginfo_t *info)
/* If the task neither was waiting for the signal nor had a signal
* handler attached to the signal, then the default action is
- * simply to ignore the signal */
- }
+ * simply to ignore the signal
+ */
- /****** OTHER SIGNAL HANDLING ******/
+ /****** OTHER SIGNAL HANDLING ******/
- /* If the task is blocked waiting for a semaphore, then that
- * task must be unblocked when a signal is received.
- */
+ /* If the task is blocked waiting for a semaphore, then that
+ * task must be unblocked when a signal is received.
+ */
- if (stcb->task_state == TSTATE_WAIT_SEM)
- {
- sem_waitirq(stcb);
- }
+ if (stcb->task_state == TSTATE_WAIT_SEM)
+ {
+ sem_waitirq(stcb);
+ }
- /* If the task is blocked waiting on a message queue, then that
- * task must be unblocked when a signal is received.
- */
+ /* If the task is blocked waiting on a message queue, then that
+ * task must be unblocked when a signal is received.
+ */
#ifndef CONFIG_DISABLE_MQUEUE
- if (stcb->task_state == TSTATE_WAIT_MQNOTEMPTY ||
- stcb->task_state == TSTATE_WAIT_MQNOTFULL)
- {
- mq_waitirq(stcb);
- }
+ if (stcb->task_state == TSTATE_WAIT_MQNOTEMPTY ||
+ stcb->task_state == TSTATE_WAIT_MQNOTFULL)
+ {
+ mq_waitirq(stcb);
+ }
#endif
+ }
}
return ret;