summaryrefslogtreecommitdiff
path: root/xmake/modules
diff options
context:
space:
mode:
authorruki <[email protected]>2020-03-04 22:39:46 +0800
committerruki <[email protected]>2020-03-04 09:58:36 +0800
commit609e9bddc9aa1315ff8cc6ebf57bc3acab0f10b1 (patch)
tree3015718ed0c801c4f048dfb93a60030fbb2418f0 /xmake/modules
parent0f6c36892cf4a3aa5f000d4e1a348a20ae3a21a7 (diff)
improve runjobs
Diffstat (limited to 'xmake/modules')
-rw-r--r--xmake/modules/private/async/runjobs.lua8
1 files changed, 2 insertions, 6 deletions
diff --git a/xmake/modules/private/async/runjobs.lua b/xmake/modules/private/async/runjobs.lua
index 422df3560..6a130380b 100644
--- a/xmake/modules/private/async/runjobs.lua
+++ b/xmake/modules/private/async/runjobs.lua
@@ -120,12 +120,8 @@ function main(name, jobfunc, opt)
local index = 0
while index < total do
running_jobs_indices = {}
- scheduler.co_group_begin(group_name, function ()
- local freemax = comax
- local co_group = scheduler.co_group(group_name)
- if co_group then
- freemax = freemax - #co_group
- end
+ scheduler.co_group_begin(group_name, function (co_group)
+ local freemax = comax - #co_group
local max = math.min(index + freemax, total)
while index < max do
index = index + 1