From b765d1781818be78accfaeb86fee01147b0498a2 Mon Sep 17 00:00:00 2001 From: patacongo Date: Thu, 29 Mar 2007 13:31:08 +0000 Subject: [PATCH] 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 --- sched/sig_received.c | 41 +++++++++++++++++++++-------------------- 1 file changed, 21 insertions(+), 20 deletions(-) diff --git a/sched/sig_received.c b/sched/sig_received.c index 6cdf1dd9f94..5db0aa09904 100644 --- a/sched/sig_received.c +++ b/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;