Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

poll: Minimize overhead when polling single event #1396

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions include/kernel.h
Original file line number Diff line number Diff line change
Expand Up @@ -3944,6 +3944,7 @@ extern void k_poll_event_init(struct k_poll_event *event, u32_t type,
*
* @retval 0 One or more events are ready.
* @retval -EAGAIN Waiting period timed out.
* @retval -EINTR Poller thread has been interrupted.
*/

extern int k_poll(struct k_poll_event *events, int num_events,
Expand Down
4 changes: 1 addition & 3 deletions kernel/poll.c
Original file line number Diff line number Diff line change
Expand Up @@ -227,9 +227,7 @@ int k_poll(struct k_poll_event *events, int num_events, s32_t timeout)
/*
* If we're not polling anymore, it means that at least one event
* condition is met, either when looping through the events here or
* because one of the events registered has had its state changed, or
* that one of the objects we wanted to poll on already had a thread
* polling on it.
* because one of the events registered has had its state changed.
*/
if (!is_polling()) {
clear_event_registrations(events, last_registered, key);
Expand Down