mirror of
https://github.com/apache/nuttx.git
synced 2025-12-06 09:01:15 +08:00
sched/signal: Unblock task waiting for event when a signal received
Some checks failed
Build Documentation / build-html (push) Has been cancelled
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:
committed by
Alan C. Assis
parent
cb5f47e56e
commit
e758e92830
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user