=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/make/job.c,v retrieving revision 1.145 retrieving revision 1.146 diff -u -r1.145 -r1.146 --- src/usr.bin/make/job.c 2020/01/04 12:50:52 1.145 +++ src/usr.bin/make/job.c 2020/01/04 16:16:37 1.146 @@ -1,4 +1,4 @@ -/* $OpenBSD: job.c,v 1.145 2020/01/04 12:50:52 espie Exp $ */ +/* $OpenBSD: job.c,v 1.146 2020/01/04 16:16:37 espie Exp $ */ /* $NetBSD: job.c,v 1.16 1996/11/06 17:59:08 christos Exp $ */ /* @@ -148,6 +148,7 @@ static void continue_job(Job *); static Job *reap_finished_job(pid_t); static bool reap_jobs(void); +static void may_continue_heldback_jobs(); static void loop_handle_running_jobs(void); static bool expensive_job(Job *); @@ -746,9 +747,14 @@ { nJobs--; postprocess_job(job); +} + +static void +may_continue_heldback_jobs() +{ while (!no_new_jobs) { if (heldJobs != NULL) { - job = heldJobs; + Job *job = heldJobs; heldJobs = heldJobs->next; if (DEBUG(EXPENSIVE)) fprintf(stderr, "[%ld] cheap -> release %s\n", @@ -803,6 +809,7 @@ job_handle_status(job, status); determine_job_next_step(job); } + may_continue_heldback_jobs(); } /* sanity check, should not happen */ if (pid == -1 && errno == ECHILD && runningJobs != NULL)