bool fail = false;
bool finish = false;
+ bool starved = false;
while(!finish)
{
- if(tasks.size()<jobs && !fail)
+ if(tasks.size()<jobs && !fail && !starved)
{
Target *tgt = cmdline->get_buildable_target();
if(tgt)
}
else if(tasks.empty())
finish = true;
+ else
+ starved = true;
}
else
Time::sleep(10*Time::msec);
for(unsigned i=0; i<tasks.size();)
{
- Task::Status status = tasks[i]->check();
+ Task::Status status;
+ if(jobs==1 || (tasks.size()==1 && starved))
+ status = tasks[i]->wait();
+ else
+ status = tasks[i]->check();
+
if(status!=Task::RUNNING)
{
++count;
fail = true;
if(tasks.empty() && fail)
finish = true;
+ starved = false;
}
else
++i;