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

commit 94cfb1180b6ed18ad6ad16cc22aef166b74a00a1
Author: wangchengdong <[email protected]>
AuthorDate: Wed Oct 29 10:41:12 2025 +0800

    sched/event: Implement nxevent_timeout with nxevent_wait_irq
    
       Implement nxevent_timeout with nxevent_wait_irq to remove
       code duplication
    
    Signed-off-by: Chengdong Wang [email protected]
---
 sched/event/event_wait.c | 28 +---------------------------
 1 file changed, 1 insertion(+), 27 deletions(-)

diff --git a/sched/event/event_wait.c b/sched/event/event_wait.c
index e55cb4dbe49..01c7553d2a7 100644
--- a/sched/event/event_wait.c
+++ b/sched/event/event_wait.c
@@ -75,33 +75,7 @@ static void nxevent_timeout(wdparm_t arg)
 
   if (wtcb->task_state == TSTATE_WAIT_EVENT)
     {
-      /* Remove the wait from the event's waiting list */
-
-      if (list_in_list(&(wait->node)))
-        {
-          list_delete(&(wait->node));
-        }
-
-      wtcb->waitobj = NULL;
-
-      /* Mark the errno value for the thread. */
-
-      wtcb->errcode = ETIMEDOUT;
-
-      FAR struct tcb_s *rtcb = this_task();
-
-      /* Remove the task from waiting list */
-
-      dq_rem((FAR dq_entry_t *)wtcb, list_waitingforsignal());
-
-      /* Add the task to ready-to-run task list, and
-       * perform the context switch if one is needed
-       */
-
-      if (nxsched_add_readytorun(wtcb))
-        {
-          up_switch_context(this_task(), rtcb);
-        }
+      nxevent_wait_irq(wtcb, ETIMEDOUT);
     }
 
   leave_critical_section(flags);

Reply via email to