summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorruki <[email protected]>2024-06-05 00:55:03 +0800
committerruki <[email protected]>2024-06-05 00:55:03 +0800
commitfce9aa8d62f09d20b79d664b134278d841dafe44 (patch)
tree1edd9e0ce64e083c5c42716cca694ae5464e7dc3
parent195ca731798e606fbd84786d81e9e56b3a547a31 (diff)
add pending job
-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