Changeset 218 for trunk/src/gmake/job.c


Ignore:
Timestamp:
Feb 8, 2005, 10:19:09 AM (20 years ago)
Author:
bird
Message:

2nd try on .NOTPARALLEL.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/gmake/job.c

    r217 r218  
    812812        lastc->next = c->next;
    813813
    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 
    818814      free_child (c);
    819815
     
    14051401    {
    14061402      /* 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. */
    14081404      set_command_state (f, cs_running);
    14091405      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;
    14111416      return 0;
    14121417    }
    14131418
    14141419  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
    14161426
    14171427  /* Start the first command; reap_children will run later command lines.  */
     
    14381448    case cs_finished:
    14391449      notice_finished_file (f);
    1440       if ((c->file->command_flags & COMMANDS_NOTPARALLEL) && not_parallel >= 1)
    1441         --not_parallel;
    14421450      free_child (c);
    14431451      break;
     
    16871695  (void) start_waiting_job (c);
    16881696
    1689   if (job_slots == 1 || not_parallel)
     1697  if (job_slots == 1 || not_parallel < 0)
    16901698    /* Since there is only one job slot, make things run linearly.
    16911699       Wait for the child to die, setting the state to `cs_finished'.  */
     
    19341942    if (job_slots_used > 0)
    19351943      --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;
    19401944
    19411945    /* If the job failed, and the -k flag was not given, die.  */
Note: See TracChangeset for help on using the changeset viewer.