diff --git a/Capy64/Assets/Lua/CapyOS/boot/autorun/01_task.lua b/Capy64/Assets/Lua/CapyOS/boot/autorun/01_event.lua similarity index 70% rename from Capy64/Assets/Lua/CapyOS/boot/autorun/01_task.lua rename to Capy64/Assets/Lua/CapyOS/boot/autorun/01_event.lua index d64f1a1..ba63155 100644 --- a/Capy64/Assets/Lua/CapyOS/boot/autorun/01_task.lua +++ b/Capy64/Assets/Lua/CapyOS/boot/autorun/01_event.lua @@ -1,5 +1,17 @@ local event = require("event") +function event.pull(...) + local ev = table.pack(coroutine.yield(...)) + if ev[1] == "interrupt" then + error("Interrupted", 2) + end + return table.unpack(ev) +end + +function event.pullRaw(...) + return coroutine.yield(...) +end + local function awaiter(task) local status = task:getStatus() local uuid = task:getID()