summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--xmake/modules/async/runjobs.lua5
1 files changed, 4 insertions, 1 deletions
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