Added core.try wrapping of function passed to core.add_thread
This commit is contained in:
1 parent
b7ec7a6acf
commit
4191cf2c08
1 file changed
+2
-1
+2
-1
@@ -173,7 +173,8 @@ end
|
|||||||
|
|
||||||
function core.add_thread(f, weak_ref)
|
function core.add_thread(f, weak_ref)
|
||||||
local key = weak_ref or #core.threads + 1
|
local key = weak_ref or #core.threads + 1
|
||||||
core.threads[key] = { cr = coroutine.create(f), wake = 0 }
|
local fn = function() return core.try(f) end
|
||||||
|
core.threads[key] = { cr = coroutine.create(fn), wake = 0 }
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user