Changeset 218 for trunk/src/gmake/job.c
- Timestamp:
- Feb 8, 2005, 10:19:09 AM (20 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/gmake/job.c
r217 r218 812 812 lastc->next = c->next; 813 813 814 /* update not_parallel if the file was flagged for that. */815 if ((c->file->command_flags & COMMANDS_NOTPARALLEL) && not_parallel >= 1)816 --not_parallel;817 818 814 free_child (c); 819 815 … … 1405 1401 { 1406 1402 /* Put this child on the chain of children waiting for the load average 1407 to go down. */1403 to go down. if not paralell, put it last. */ 1408 1404 set_command_state (f, cs_running); 1409 1405 c->next = waiting_jobs; 1410 waiting_jobs = c; 1406 if (c->next && (c->file->command_flags & COMMANDS_NOTPARALLEL)) 1407 { 1408 struct child *prev = waiting_jobs; 1409 while (prev->next) 1410 prev = prev->next; 1411 c->next = 0; 1412 prev->next = c; 1413 } 1414 else 1415 waiting_jobs = c; 1411 1416 return 0; 1412 1417 } 1413 1418 1414 1419 if (c->file->command_flags & COMMANDS_NOTPARALLEL) 1415 ++not_parallel; 1420 { 1421 assert(not_parallel == 0); 1422 DB (DB_KMK, (_("not_parallel %d -> %d (file=%p `%s')\n"), not_parallel, not_parallel + 1, c->file, c->file->name)); 1423 ++not_parallel; 1424 } 1425 1416 1426 1417 1427 /* Start the first command; reap_children will run later command lines. */ … … 1438 1448 case cs_finished: 1439 1449 notice_finished_file (f); 1440 if ((c->file->command_flags & COMMANDS_NOTPARALLEL) && not_parallel >= 1)1441 --not_parallel;1442 1450 free_child (c); 1443 1451 break; … … 1687 1695 (void) start_waiting_job (c); 1688 1696 1689 if (job_slots == 1 || not_parallel )1697 if (job_slots == 1 || not_parallel < 0) 1690 1698 /* Since there is only one job slot, make things run linearly. 1691 1699 Wait for the child to die, setting the state to `cs_finished'. */ … … 1934 1942 if (job_slots_used > 0) 1935 1943 --job_slots_used; 1936 1937 /* update not_parallel if the file was flagged for that. */1938 if ((c->file->command_flags & COMMANDS_NOTPARALLEL) && not_parallel >= 1)1939 --not_parallel;1940 1944 1941 1945 /* If the job failed, and the -k flag was not given, die. */
Note:
See TracChangeset
for help on using the changeset viewer.