summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorruki <[email protected]>2020-03-12 00:37:26 +0800
committerruki <[email protected]>2020-03-11 21:44:39 +0800
commit75164e870c8348960856bf6a42ac897c292b6dcd (patch)
tree7bfc89d86ffc49c5d37ab24295f2f7956d0ada0d
parentffdc3aec032bf2490020287ff7afc32fd6df9729 (diff)
fix runjobs
-rw-r--r--xmake/modules/private/action/build/object.lua4
-rw-r--r--xmake/modules/private/async/runjobs.lua8
2 files changed, 9 insertions, 3 deletions
diff --git a/xmake/modules/private/action/build/object.lua b/xmake/modules/private/action/build/object.lua
index 1f57c8b37..2275945e1 100644
--- a/xmake/modules/private/action/build/object.lua
+++ b/xmake/modules/private/action/build/object.lua
@@ -84,7 +84,7 @@ function _do_build_file(target, sourcefile, opt)
end
-- build object
-function _build_object(target, sourcebatch, opt)
+function _build_object(target, sourcefile, opt)
-- do before build
local before_build_file = target:script("build_file_before")
@@ -116,7 +116,7 @@ function main(target, batchjobs, sourcebatch, opt)
local dependfile = sourcebatch.dependfiles[i]
local sourcekind = assert(sourcebatch.sourcekind, "%s: sourcekind not found!", sourcefile)
batchjobs:addjob(sourcefile, function (index, total)
- _build_object(target, sourcebatch, {objectfile = objectfile, dependfile = dependfile, sourcekind = sourcekind, progress = (index * 100) / total})
+ _build_object(target, sourcefile, {objectfile = objectfile, dependfile = dependfile, sourcekind = sourcekind, progress = (index * 100) / total})
end, rootjob)
end
end
diff --git a/xmake/modules/private/async/runjobs.lua b/xmake/modules/private/async/runjobs.lua
index 3a764dafc..2b848bde5 100644
--- a/xmake/modules/private/async/runjobs.lua
+++ b/xmake/modules/private/async/runjobs.lua
@@ -152,7 +152,13 @@ function main(name, jobs, opt)
if not jobs_cb then
-- get job priority
- local job, priority = job_pending or jobs:pop()
+ local job, priority
+ if job_pending then
+ job = job_pending
+ priority = priority_prev
+ else
+ job, priority = jobs:pop()
+ end
if not job then
break
end