mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-04 18:41:51 +00:00
add 'await' function
This commit is contained in:
parent
b28aa71845
commit
ddb04418ba
1 changed files with 12 additions and 0 deletions
|
|
@ -20,6 +20,18 @@ if not ipairs_mt_supported then
|
|||
end
|
||||
end
|
||||
|
||||
function await(co)
|
||||
local res, err
|
||||
while coroutine.status(co) ~= 'dead' do
|
||||
coroutine.yield()
|
||||
res, err = coroutine.resume(co)
|
||||
if err then
|
||||
return res, err
|
||||
end
|
||||
end
|
||||
return res, err
|
||||
end
|
||||
|
||||
local _ffi = ffi
|
||||
function __vc_Canvas_set_data(self, data)
|
||||
if type(data) == "cdata" then
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue