Skip to content

Commit f084685

Browse files
anchaoxiaoxiang781216
authored andcommitted
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 <[email protected]>
1 parent 85c39e9 commit f084685

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

sched/event/event_post.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -150,12 +150,12 @@ int nxevent_post(FAR nxevent_t *event, nxevent_mask_t events,
150150
}
151151
}
152152

153-
sched_unlock();
154-
155153
if (clear)
156154
{
157155
event->events &= ~clear;
158156
}
157+
158+
sched_unlock();
159159
}
160160

161161
leave_critical_section(flags);

0 commit comments

Comments
 (0)