From 44d0b353d360353bd17e5943b7bb051b68c0f278 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucio=20Andr=C3=A9s=20Illanes=20Albornoz=20=28arab=2C=20vx?= =?UTF-8?q?p=29?= Date: Tue, 5 Dec 2017 16:53:38 +0000 Subject: subr/ex_pkg_dispatch.subr:ex_pkg_dispatch(): dispatch ${_njobs_max} jobs prior to entering FIFO loop. --- subr/ex_pkg_dispatch.subr | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/subr/ex_pkg_dispatch.subr b/subr/ex_pkg_dispatch.subr index 43d3fb60..f56146bf 100644 --- a/subr/ex_pkg_dispatch.subr +++ b/subr/ex_pkg_dispatch.subr @@ -55,10 +55,16 @@ ex_pkg_dispatch() { while [ ${#} -gt 0 ]; do _script_rc=0; _njobs=0; ex_rtl_fileop mkfifo "${_pipe_path}"; - exp_pkg_dispatch "${1}" "${_tgt_name}" \ - "${_restart_at}" "${_dispatch_fn}" \ - "${_stderrout_path}" "${_pipe_path}" \ - _njobs; shift; + for _njob in $(seq 1 $((${_njobs_max}-${_njobs}))); do + if [ ${#} -eq 0 ]; then + break; + else + exp_pkg_dispatch "${1}" "${_tgt_name}" \ + "${_restart_at}" "${_dispatch_fn}" \ + "${_stderrout_path}" "${_pipe_path}" \ + _njobs; shift; + fi; + done; if [ "${_njobs:-0}" -gt 0 ]; then while read _pipe_msg; do case "${_pipe_msg%% *}" in -- cgit v1.2.3