diff --git a/io/epoll.cpp b/io/epoll.cpp index a45ec09f..487aaf63 100644 --- a/io/epoll.cpp +++ b/io/epoll.cpp @@ -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) {