diff options
author | Robert Iannucci <robbie@rail.com> | 2012-10-04 00:25:23 (GMT) |
---|---|---|
committer | Robert A Iannucci Jr <iannucci@chromium.org> | 2012-11-09 04:25:39 (GMT) |
commit | 307f0bbd13d881cc2883c3e5f7f385b8f7914480 (patch) | |
tree | 2950aeabc8412b3662d4abcf4387bffae15eafa2 /src/build.cc | |
parent | aca4ec54656057e58ca7a9ae5de7f94c869b2ccb (diff) | |
download | Ninja-307f0bbd13d881cc2883c3e5f7f385b8f7914480.zip Ninja-307f0bbd13d881cc2883c3e5f7f385b8f7914480.tar.gz Ninja-307f0bbd13d881cc2883c3e5f7f385b8f7914480.tar.bz2 |
and some basic implementation
Diffstat (limited to 'src/build.cc')
-rw-r--r-- | src/build.cc | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/src/build.cc b/src/build.cc index 0710e51..2794c6c 100644 --- a/src/build.cc +++ b/src/build.cc @@ -409,19 +409,19 @@ Edge* Plan::FindWork() { } void Plan::ScheduleWork(Edge* edge) { - // TODO(iannucci): See if this should get delayed instead - // if edge has pool - // create pool if DNE - // pool.InsertEdge(edge) - // ready_.insert(pool.GetAvailableEdges()) - // else - ready_.insert(edge); + Pool& pool = edge->pool(); + if (pool.ShouldDelayEdge(*edge)) { + pool.DelayEdge(edge); + pool.RetrieveReadyEdges(&ready_); + } else { + pool.EdgeScheduled(*edge); + ready_.insert(edge); + } } void Plan::ResumeDelayedJobs(Edge* edge) { - // if edge has pool - // pool.ReturnUnits(edge) - // ready_.insert(pool.GetAvailableEdges()) + edge->pool().EdgeFinished(*edge); + edge->pool().RetrieveReadyEdges(&ready_); } void Plan::EdgeFinished(Edge* edge) { |