diff options
| -rw-r--r-- | xmake/core/base/poller.lua | 7 | ||||
| -rw-r--r-- | xmake/core/base/scheduler.lua | 4 |
2 files changed, 4 insertions, 7 deletions
diff --git a/xmake/core/base/poller.lua b/xmake/core/base/poller.lua index 521b63458..335ba98a6 100644 --- a/xmake/core/base/poller.lua +++ b/xmake/core/base/poller.lua @@ -56,11 +56,8 @@ function poller:_pollerdata_set(cdata, data) end -- support events? -function poller:support(otype, events) - if otype == poller.OT_SOCK then - return io.poller_support(events) - end - return false, string.format("invalid poller object type(%d)!", otype) +function poller:support(events) + return io.poller_support(events) end -- spank poller to break the wait() and return all triggered events diff --git a/xmake/core/base/scheduler.lua b/xmake/core/base/scheduler.lua index 5a92863b8..e7870dbe6 100644 --- a/xmake/core/base/scheduler.lua +++ b/xmake/core/base/scheduler.lua @@ -315,7 +315,7 @@ function scheduler:poller_wait(obj, events, timeout) end -- enable edge-trigger mode if be supported - if otype == poller.OT_SOCK and self._SUPPORT_EV_POLLER_CLEAR then + if self._SUPPORT_EV_POLLER_CLEAR and (otype == poller.OT_SOCK or otype == poller.OT_PIPE) then events = bit.bor(events, poller.EV_POLLER_CLEAR) end @@ -463,7 +463,7 @@ function scheduler:runloop() self._STARTED = true -- ensure poller has been initialized first (for windows/iocp) and check edge-trigger mode (for epoll/kqueue) - if poller:support(poller.OT_SOCK, poller.EV_POLLER_CLEAR) then + if poller:support(poller.EV_POLLER_CLEAR) then self._SUPPORT_EV_POLLER_CLEAR = true end |
