Love2d newFunction working
This commit is contained in:
parent
d8aeefd202
commit
79f58a79f9
@ -62,23 +62,22 @@ function multi:newSystemThread(name,func,...)
|
|||||||
GLOBAL["__THREAD_COUNT"] = THREAD_ID
|
GLOBAL["__THREAD_COUNT"] = THREAD_ID
|
||||||
THREAD_ID=THREAD_ID + 1
|
THREAD_ID=THREAD_ID + 1
|
||||||
thread:newThread(function()
|
thread:newThread(function()
|
||||||
while true do
|
thread.hold(function()
|
||||||
thread.yield()
|
return not c.thread:isRunning()
|
||||||
if c.stab["returns"] then
|
end)
|
||||||
c.OnDeath:Fire(c,unpack(t.stab.returns))
|
print("Thread: "..name.." finished executing...")
|
||||||
t.stab.returns = nil
|
-- If the thread is not running let's handle that.
|
||||||
thread.kill()
|
local thread_err = c.thread:getError()
|
||||||
end
|
if thread_err == "Thread Killed!\1" then
|
||||||
local error = c.thread:getError()
|
print("Killed...")
|
||||||
if error then
|
c.OnDeath:Fire(c,"Thread Killed!")
|
||||||
if error:find("Thread Killed!\1") then
|
elseif thread_err then
|
||||||
c.OnDeath:Fire(c, "Thread Killed!")
|
print("Error...",thread_err)
|
||||||
thread.kill()
|
c.OnError:Fire(c,thread_err)
|
||||||
else
|
elseif c.stab.returns then
|
||||||
c.OnError:Fire(c, error)
|
print("Returns",unpack(c.stab.returns))
|
||||||
thread.kill()
|
c.OnDeath:Fire(c,unpack(c.stab.returns))
|
||||||
end
|
c.stab.returns = nil
|
||||||
end
|
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
return c
|
return c
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user