V15.2.0 #33

Merged
rayaman merged 75 commits from v15.2.0 into master 2022-04-19 18:45:52 -04:00
Showing only changes of commit 79f58a79f9 - Show all commits

View File

@ -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