From 48649de60859093d9ca9f5ff7456d86f112073be Mon Sep 17 00:00:00 2001 From: Coder12a <38924418+Coder12a@users.noreply.github.com> Date: Wed, 17 Apr 2019 19:08:36 -0500 Subject: [PATCH] Do: not run schedule again on thread death --- async.lua | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/async.lua b/async.lua index 2677636..c618df5 100644 --- a/async.lua +++ b/async.lua @@ -27,7 +27,6 @@ function extended_api.Async() local thread = self.pool.threads[index] if not thread or coroutine.status(thread) == "dead" then table.remove(self.pool.threads, index) - minetest.after(0, self.schedule_worker) return false else coroutine.resume(thread) @@ -40,7 +39,6 @@ function extended_api.Async() local thread = self.pool.globalstep_threads[index] if not thread or coroutine.status(thread) == "dead" then table.remove(self.pool.globalstep_threads, index) - minetest.after(0, self.schedule_globalstep_worker) return false else coroutine.resume(thread) @@ -99,7 +97,7 @@ function extended_api.Async() local last_time = minetest.get_us_time() / 1000 local maxtime = self.pool.maxtime for k,v in ipairs(array) do - local b = func(k,v) + local b = func(k, v) if b ~= nil and b == false then break end