From fce9aa8d62f09d20b79d664b134278d841dafe44 Mon Sep 17 00:00:00 2001 From: ruki Date: Wed, 5 Jun 2024 00:55:03 +0800 Subject: add pending job --- xmake/modules/async/runjobs.lua | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/xmake/modules/async/runjobs.lua b/xmake/modules/async/runjobs.lua index c0f8d4c3d..0c2a6f366 100644 --- a/xmake/modules/async/runjobs.lua +++ b/xmake/modules/async/runjobs.lua @@ -157,6 +157,7 @@ function main(name, jobs, opt) local abort = false local abort_errors local progress_wrapper = {} + local job_pending progress_wrapper.current = function () return count end @@ -193,7 +194,7 @@ function main(name, jobs, opt) if not jobs_cb then -- get free job - job = jobs:getfree() + job = job_pending and job_pending or jobs:getfree() if not job then break end @@ -203,6 +204,7 @@ function main(name, jobs, opt) if job.distcc then distccjob = true else + job_pending = job break end end @@ -210,6 +212,7 @@ function main(name, jobs, opt) -- get run function jobfunc = job.run jobname = job.name + job_pending = nil else jobname = tostring(index) end -- cgit v1.3.1