summaryrefslogtreecommitdiff
path: root/xmake/core/base/scheduler.lua
diff options
context:
space:
mode:
authorruki <[email protected]>2020-02-05 00:34:53 +0800
committerruki <[email protected]>2020-02-07 22:45:56 +0800
commit94d3eb649e489a597a2f5d966d2249a9e64d87e3 (patch)
treec5bb5c3286c64a5ca491b2aacc0c09a4c9cc84ba /xmake/core/base/scheduler.lua
parenta615d353a701e0d23e322060e5dd8e364d38dfee (diff)
impl private.async.runjobs
Diffstat (limited to 'xmake/core/base/scheduler.lua')
-rw-r--r--xmake/core/base/scheduler.lua10
1 files changed, 5 insertions, 5 deletions
diff --git a/xmake/core/base/scheduler.lua b/xmake/core/base/scheduler.lua
index 6c3b511b1..b1091caf6 100644
--- a/xmake/core/base/scheduler.lua
+++ b/xmake/core/base/scheduler.lua
@@ -89,7 +89,7 @@ end
-- tostring(coroutine)
function _coroutine:__tostring()
- return string.format("<co: %s/%s>", self:thread(), self:name())
+ return string.format("<co: %s/%s>", self:name(), self:status())
end
-- gc(coroutine)
@@ -265,13 +265,13 @@ function scheduler:_co_groups_resume()
-- resume the waiting coroutine of this group
local co_waiting = self._CO_GROUPS_WAITING[name]
if co_waiting and co_waiting:is_suspended() then
+ resumed_count = resumed_count + 1
+ self._CO_GROUPS_WAITING[name] = nil
+ self:_co_tasks_suspended():remove(co_waiting)
local ok, errors = self:co_resume(co_waiting)
if not ok then
return -1, errors
end
- resumed_count = resumed_count + 1
- self._CO_GROUPS_WAITING[name] = nil
- self:_co_tasks_suspended():remove(co_waiting)
end
end
end
@@ -703,7 +703,7 @@ function scheduler:runloop()
if resumed_count < 0 then
ok = false
errors = resumed_errors
- break;
+ break
elseif resumed_count == 0 then
-- get the next timeout