mirror of
https://github.com/Ale32bit/Capy64.git
synced 2025-01-18 18:46:43 +00:00
Replace native event.pull event.pullRaw with Lua functions
This commit is contained in:
parent
e520383da3
commit
756b8b35dd
1 changed files with 12 additions and 0 deletions
|
@ -1,5 +1,17 @@
|
||||||
local event = require("event")
|
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 function awaiter(task)
|
||||||
local status = task:getStatus()
|
local status = task:getStatus()
|
||||||
local uuid = task:getID()
|
local uuid = task:getID()
|
Loading…
Reference in a new issue