diff --git a/wmake/wmakeCollect b/wmake/wmakeCollect index 4a3525a342..cace7450d4 100755 --- a/wmake/wmakeCollect +++ b/wmake/wmakeCollect @@ -157,4 +157,12 @@ else fi fi + +#------------------------------------------------------------------------------ +# Cleanup local variables and functions +#------------------------------------------------------------------------------ + +unset Script usage + + #------------------------------------------------------------------------------ diff --git a/wmake/wmakeLnIncludeAll b/wmake/wmakeLnIncludeAll index 4aedc1257f..06dc51e286 100755 --- a/wmake/wmakeLnIncludeAll +++ b/wmake/wmakeLnIncludeAll @@ -117,12 +117,13 @@ do then # If running in parallel start wmakeLnInclude on nCores # and more as the cores become free - if [ "$nCores" -gt 0 ] + if [ "$nCores" > 0 ] then joblist=($(jobs -p)) while (( ${#joblist[*]} > $nCores )) do - sleep 0.01 + # When the job limit is reached wait for a job to finish + wait -n joblist=($(jobs -p)) done wmakeLnInclude -update $topDir & @@ -138,22 +139,6 @@ do done done -# If running in parallel wait until all wmakeLnInclude jobs are complete -if [ "$nCores" -gt 0 ] -then - for job in $(jobs -p) - do - echo $job - wait $job || let "FAIL+=1" - done - - if [ "$FAIL" == "0" ]; - then - echo "$Script: completed wmakeLnInclude processes" - else - echo "$Script: failed ($FAIL)" - fi -fi #------------------------------------------------------------------------------ # Cleanup local variables and functions