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

PR 0.7 to main #468

Merged
merged 7 commits into from
Apr 29, 2024
Merged
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
7 changes: 2 additions & 5 deletions io/epoll.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -203,11 +203,8 @@ ok: entry.interests |= eint;
int do_epoll_wait(uint64_t timeout) {
assert(_events_remain == 0);
uint8_t cool_down_ms = 1;
// since timeout may less than 1ms
// in such condition, timeout_ms should be at least 1
// or it may call epoll_wait without any idle
timeout = (timeout && timeout < 1024) ? 1 : timeout / 1024;
timeout &= 0x7fffffff; // make sure less than INT32_MAX
// epoll_wait 0ms should be OK, make sure less than INT32_MAX
timeout = (timeout / 1000) & 0x7fffffff;
while (_engine_fd > 0) {
int ret = ::epoll_wait(_engine_fd, _events, LEN(_events), timeout);
if (ret < 0) {
Expand Down
Loading