Do: not run schedule again on thread death
This commit is contained in:
parent
229bd3ea6d
commit
977c19efde
|
@ -34,7 +34,6 @@ function extended_api.Async()
|
||||||
local thread = self.pool.threads[index]
|
local thread = self.pool.threads[index]
|
||||||
if not thread or coroutine.status(thread) == "dead" then
|
if not thread or coroutine.status(thread) == "dead" then
|
||||||
table.remove(self.pool.threads, index)
|
table.remove(self.pool.threads, index)
|
||||||
minetest.after(0, self.schedule_worker)
|
|
||||||
return false
|
return false
|
||||||
else
|
else
|
||||||
coroutine.resume(thread)
|
coroutine.resume(thread)
|
||||||
|
@ -47,7 +46,6 @@ function extended_api.Async()
|
||||||
local thread = self.pool.globalstep_threads[index]
|
local thread = self.pool.globalstep_threads[index]
|
||||||
if not thread or coroutine.status(thread) == "dead" then
|
if not thread or coroutine.status(thread) == "dead" then
|
||||||
table.remove(self.pool.globalstep_threads, index)
|
table.remove(self.pool.globalstep_threads, index)
|
||||||
minetest.after(0, self.schedule_globalstep_worker)
|
|
||||||
return false
|
return false
|
||||||
else
|
else
|
||||||
coroutine.resume(thread)
|
coroutine.resume(thread)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user