sched/signal: Unblock task waiting for event when a signal received
Some checks failed
Build Documentation / build-html (push) Has been cancelled

If the task is blocked waiting for a event, then that task must
 be unblocked when a signal is received.

Signed-off-by: Chengdong Wang <wangchengdong@lixiang.com>
This commit is contained in:
wangchengdong
2025-11-22 15:44:09 +08:00
committed by Alan C. Assis
parent cb5f47e56e
commit e758e92830

View File

@@ -43,6 +43,7 @@
#include "sched/sched.h"
#include "group/group.h"
#include "semaphore/semaphore.h"
#include "event/event.h"
#include "signal/signal.h"
#include "mqueue/mqueue.h"
@@ -655,6 +656,17 @@ int nxsig_tcbdispatch(FAR struct tcb_s *stcb, siginfo_t *info,
nxsem_wait_irq(stcb, EINTR);
}
#ifdef CONFIG_SCHED_EVENTS
/* If the task is blocked waiting for a event, then that task must
* be unblocked when a signal is received.
*/
else if (stcb->task_state == TSTATE_WAIT_EVENT)
{
nxevent_wait_irq(stcb, EINTR);
}
#endif
#if !defined(CONFIG_DISABLE_MQUEUE) || !defined(CONFIG_DISABLE_MQUEUE_SYSV)
/* If the task is blocked waiting on a message queue, then that task
* must be unblocked when a signal is received.