Skip to content
Open
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
Original file line number Diff line number Diff line change
Expand Up @@ -159,9 +159,11 @@ EventsExecutor::spin_once_impl(std::chrono::nanoseconds timeout)
}

// Select the smallest between input timeout and timer timeout
bool is_timer_timeout = false;
auto next_timer_timeout = timers_manager_->get_head_timeout();
if (next_timer_timeout < timeout) {
timeout = next_timer_timeout;
is_timer_timeout = true;
}

ExecutorEvent event;
Expand All @@ -171,7 +173,7 @@ EventsExecutor::spin_once_impl(std::chrono::nanoseconds timeout)
// arrived before any of the timers expired.
if (has_event) {
this->execute_event(event);
} else {
} else if (is_timer_timeout) {
timers_manager_->execute_head_timer();
}
}
Expand Down