summaryrefslogtreecommitdiffstats
path: root/src/build.cc
diff options
context:
space:
mode:
authorScott Graham <scottmg@chromium.org>2015-04-24 23:06:55 (GMT)
committerScott Graham <scottmg@chromium.org>2015-04-24 23:06:55 (GMT)
commit4c4887d26011225deaa20b6752193be0293624ab (patch)
treed1c616d2326226d532bd00c8627609b950a8a3e7 /src/build.cc
parentdcdd042ca93fd0057d7e1b0eedfbab49790b2e00 (diff)
downloadNinja-4c4887d26011225deaa20b6752193be0293624ab.zip
Ninja-4c4887d26011225deaa20b6752193be0293624ab.tar.gz
Ninja-4c4887d26011225deaa20b6752193be0293624ab.tar.bz2
avoid calling ResumeDelayedJobs instead
Diffstat (limited to 'src/build.cc')
-rw-r--r--src/build.cc13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/build.cc b/src/build.cc
index f14831e..e266b5c 100644
--- a/src/build.cc
+++ b/src/build.cc
@@ -379,7 +379,7 @@ void Plan::ResumeDelayedJobs(Edge* edge) {
edge->pool()->RetrieveReadyEdges(&ready_);
}
-void Plan::EdgeFinished(Edge* edge) {
+void Plan::EdgeFinished(Edge* edge, bool directly_wanted) {
map<Edge*, bool>::iterator e = want_.find(edge);
assert(e != want_.end());
if (e->second)
@@ -388,7 +388,10 @@ void Plan::EdgeFinished(Edge* edge) {
edge->outputs_ready_ = true;
// See if this job frees up any delayed jobs
- ResumeDelayedJobs(edge);
+ if (directly_wanted)
+ ResumeDelayedJobs(edge);
+ else
+ edge->pool()->RetrieveReadyEdges(&ready_);
// Check off any nodes we were waiting for with this edge.
for (vector<Node*>::iterator o = edge->outputs_.begin();
@@ -411,10 +414,8 @@ void Plan::NodeFinished(Node* node) {
ScheduleWork(*oe);
} else {
// We do not need to build this edge, but we might need to build one of
- // its dependents. Make sure the pool schedules it before it's finished
- // otherwise the pool use count may be invalid.
- (*oe)->pool()->EdgeScheduled(**oe);
- EdgeFinished(*oe);
+ // its dependents.
+ EdgeFinished(*oe, want_e->second);
}
}
}