Fix parallel mode deadlock when MAX_JOBS > number of sources.

This commit is contained in:
Darko Poljak 2018-01-30 09:48:43 +01:00
parent bd0fe05003
commit fc0b86005c
1 changed files with 7 additions and 2 deletions

View File

@ -455,9 +455,14 @@ if [ "${PARALLEL}" ]; then
trap "${TRAPFUNC}" 0 1 2 15
# determine how much parallel jobs to prestart
if [ "${MAX_JOBS}" ] && [ "${MAX_JOBS}" -le "${no_sources}" ]
if [ "${MAX_JOBS}" ]
then
prestart="${MAX_JOBS}"
if [ "${MAX_JOBS}" -le "${no_sources}" ]
then
prestart="${MAX_JOBS}"
else
prestart="${no_sources}"
fi
else
prestart=0
fi