This commit is contained in:
kepler155c@gmail.com
2016-12-27 16:01:06 -05:00
parent 5c12b20fae
commit c2500f0167
5 changed files with 29 additions and 38 deletions

View File

@@ -121,14 +121,9 @@ end
local exitPullEvents = false
local function _pullEvents()
--exitPullEvents = false
while true do
local e = { Process:pullEvent() }
local e = { os.pullEvent() }
Event.processEvent(e)
if exitPullEvents or e[1] == 'terminate' then
break
end
end
end
@@ -144,13 +139,19 @@ function Event.addThread(fn)
end
function Event.pullEvents(...)
Process:addThread(_pullEvents)
local routines = { ... }
if #routines > 0 then
for _, routine in ipairs(routines) do
Process:addThread(routine)
end
end
_pullEvents()
while true do
local e = Process:pullEvent()
if exitPullEvents or e == 'terminate' then
break
end
end
end
function Event.exitPullEvents()