sched/event: clear pending events before enable the scheduler

enable the scheduler may cause the context to switch to a high-priority task,
which will failure to clear pending events correctly.

Signed-off-by: chao an <anchao@lixiang.com>
This commit is contained in:
chao an 2024-09-02 12:49:30 +08:00 committed by Xiang Xiao
parent 85c39e96d6
commit f084685da8

View File

@ -150,12 +150,12 @@ int nxevent_post(FAR nxevent_t *event, nxevent_mask_t events,
}
}
sched_unlock();
if (clear)
{
event->events &= ~clear;
}
sched_unlock();
}
leave_critical_section(flags);