diff options
Diffstat (limited to 'xmake/core/sandbox/modules/process.lua')
| -rw-r--r-- | xmake/core/sandbox/modules/process.lua | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/xmake/core/sandbox/modules/process.lua b/xmake/core/sandbox/modules/process.lua index 619a3dfc6..e69a05e21 100644 --- a/xmake/core/sandbox/modules/process.lua +++ b/xmake/core/sandbox/modules/process.lua @@ -23,6 +23,7 @@ -- -- load modules +local process = require("base/process") local sandbox = require("sandbox/sandbox") local raise = require("sandbox/modules/raise") local vformat = require("sandbox/modules/vformat") @@ -127,6 +128,25 @@ function sandbox_process.waitlist(processes, timeout) return infos end +-- async run task and echo waiting info +function sandbox_process.asyncrun(task, waitchars) + + -- async run it + local ok, errors = process.asyncrun(task, waitchars) + if not ok then + raise(errors) + end +end + +-- run jobs with processes +function sandbox_process.runjobs(jobfunc, total, comax) + + -- run them + local ok, errors = process.runjobs(jobfunc, total, comax) + if not ok then + raise(errors) + end +end + -- return module return sandbox_process - |
