summaryrefslogtreecommitdiff
path: root/xmake/core/base/scheduler.lua
diff options
context:
space:
mode:
authorruki <[email protected]>2020-01-30 22:48:01 +0800
committerruki <[email protected]>2020-01-30 10:48:06 +0800
commit4cb343a145c152bd3ac3da8704337905408699dc (patch)
tree2948043b2a1d6778e68a7b273feb649879d0e7a0 /xmake/core/base/scheduler.lua
parente992084750b81a09a56fc0a7c428b3861cfb04dc (diff)
improve core/poller
Diffstat (limited to 'xmake/core/base/scheduler.lua')
-rw-r--r--xmake/core/base/scheduler.lua17
1 files changed, 5 insertions, 12 deletions
diff --git a/xmake/core/base/scheduler.lua b/xmake/core/base/scheduler.lua
index e4c4a577a..98a63f2c4 100644
--- a/xmake/core/base/scheduler.lua
+++ b/xmake/core/base/scheduler.lua
@@ -494,18 +494,11 @@ function scheduler:runloop()
-- resume all suspended tasks with events
for _, e in ipairs(events) do
- local otype = e[1]
- if otype == poller.OT_SOCK then
- local sock = e[2]
- local sockevents = e[3]
- local sockfunc = e[4]
- if sockfunc then
- sockfunc(self, sock, sockevents)
- end
- else
- ok = false
- errors = string.format("invalid poller object type(%d)", otype)
- break
+ local obj = e[1]
+ local objevents = e[2]
+ local eventfunc = e[3]
+ if eventfunc then
+ eventfunc(self, obj, objevents)
end
end