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);