Skip to content

Commit

Permalink
sched/event: clear pending events before enable the scheduler
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
anchao committed Sep 2, 2024
1 parent 63ed723 commit 8bb4de8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions sched/event/event_post.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 8bb4de8

Please sign in to comment.