This is an automated email from the ASF dual-hosted git repository.

acassis pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git


The following commit(s) were added to refs/heads/master by this push:
     new e758e92830e sched/signal: Unblock task waiting for event when a signal 
received
e758e92830e is described below

commit e758e92830e53a632e74bd0dbc5c9a56b8e777d0
Author: wangchengdong <[email protected]>
AuthorDate: Sat Nov 22 15:44:09 2025 +0800

    sched/signal: Unblock task waiting for event when a signal received
    
     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 <[email protected]>
---
 sched/signal/sig_dispatch.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/sched/signal/sig_dispatch.c b/sched/signal/sig_dispatch.c
index e1cd559f49a..64987f3a696 100644
--- a/sched/signal/sig_dispatch.c
+++ b/sched/signal/sig_dispatch.c
@@ -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.

Reply via email to