summaryrefslogtreecommitdiff
path: root/xmake/modules/private/async/runjobs.lua
diff options
context:
space:
mode:
authorruki <[email protected]>2022-05-14 12:23:13 +0800
committerruki <[email protected]>2022-05-14 12:23:13 +0800
commit60b2376a7520df9a611a1051663da67b119925aa (patch)
treef4fa39f9955b4726a0cae1a0aac745918b4e045b /xmake/modules/private/async/runjobs.lua
parent6b8299c79e6b8f1548f52b02295a03dcfeccd995 (diff)
schedule local jobs
Diffstat (limited to 'xmake/modules/private/async/runjobs.lua')
-rw-r--r--xmake/modules/private/async/runjobs.lua17
1 files changed, 14 insertions, 3 deletions
diff --git a/xmake/modules/private/async/runjobs.lua b/xmake/modules/private/async/runjobs.lua
index 9179e6a76..0089456bf 100644
--- a/xmake/modules/private/async/runjobs.lua
+++ b/xmake/modules/private/async/runjobs.lua
@@ -171,6 +171,7 @@ function main(name, jobs, opt)
-- uses job pool?
local jobname
+ local localjob = true
if not jobs_cb then
-- get job priority
@@ -194,9 +195,13 @@ function main(name, jobs, opt)
end
-- we can only continue to run the job with distcc if local jobs are full
- if index >= local_max and not job.distcc then
- job_pending = job
- break
+ if distcc and index >= local_max then
+ if job.distcc then
+ localjob = false
+ else
+ job_pending = job
+ break
+ end
end
-- get run function
@@ -213,6 +218,12 @@ function main(name, jobs, opt)
try
{
function()
+ if distcc then
+ local co_running = scheduler.co_running()
+ if co_running then
+ co_running:data_set("distcc.localjob", localjob)
+ end
+ end
running_jobs_indices[i] = i
if jobfunc then
if opt.curdir then