1
0
mirror of https://github.com/kepler155c/opus synced 2025-12-19 22:58:06 +00:00

transition to kernel

This commit is contained in:
kepler155c@gmail.com
2018-01-20 07:18:13 -05:00
parent d85e9b96b2
commit 1c1eb9b782
28 changed files with 398 additions and 228 deletions

View File

@@ -154,8 +154,10 @@ function Event.pullEvents(...)
end
repeat
local e = Event.pullEvent()
until e[1] == 'terminate'
Event.pullEvent()
until Event.terminate
Event.terminate = false
end
function Event.exitPullEvents()
@@ -203,11 +205,12 @@ function Event.pullEvent(eventType)
while true do
local e = { os.pullEventRaw() }
Event.terminate = Event.terminate or e[1] == 'terminate'
processHandlers(e[1])
processRoutines(table.unpack(e))
if Event.terminate or e[1] == 'terminate' then
Event.terminate = false
if Event.terminate then
return { 'terminate' }
end