diff options
Diffstat (limited to 'xmake/modules/private/async/runjobs.lua')
| -rw-r--r-- | xmake/modules/private/async/runjobs.lua | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/xmake/modules/private/async/runjobs.lua b/xmake/modules/private/async/runjobs.lua index 487d11798..ed007291c 100644 --- a/xmake/modules/private/async/runjobs.lua +++ b/xmake/modules/private/async/runjobs.lua @@ -73,6 +73,14 @@ function main(name, jobs, opt) progress_helper = progress.new(nil, opt) end + -- isolate environments + local is_isolated = false + local co_running = scheduler.co_running() + if co_running and opt.isolate then + is_isolated = co_running:is_isolated() + co_running:isolate(true) + end + -- run timer local stop = false local running_jobs_indices = {} @@ -235,6 +243,11 @@ function main(name, jobs, opt) -- wait all jobs exited scheduler.co_group_wait(group_name) + -- restore isolated environments + if co_running and opt.isolate then + co_running:isolate(is_isolated) + end + -- stop timer stop = true |
