summaryrefslogtreecommitdiffstats
path: root/src/state.h
diff options
context:
space:
mode:
authorRobert Iannucci <robbie@rail.com>2012-10-04 00:25:23 (GMT)
committerRobert A Iannucci Jr <iannucci@chromium.org>2012-11-09 04:25:39 (GMT)
commit307f0bbd13d881cc2883c3e5f7f385b8f7914480 (patch)
tree2950aeabc8412b3662d4abcf4387bffae15eafa2 /src/state.h
parentaca4ec54656057e58ca7a9ae5de7f94c869b2ccb (diff)
downloadNinja-307f0bbd13d881cc2883c3e5f7f385b8f7914480.zip
Ninja-307f0bbd13d881cc2883c3e5f7f385b8f7914480.tar.gz
Ninja-307f0bbd13d881cc2883c3e5f7f385b8f7914480.tar.bz2
and some basic implementation
Diffstat (limited to 'src/state.h')
-rw-r--r--src/state.h12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/state.h b/src/state.h
index 3e569cf..e3137c4 100644
--- a/src/state.h
+++ b/src/state.h
@@ -39,24 +39,26 @@ struct Pool {
int depth() const { return depth_; }
const string& name() const { return name_; }
- /// true if the Pool would delay this edge
- bool ShouldDelayEdge(Edge* edge);
+ /// true if the Pool might delay this edge
+ bool ShouldDelayEdge(const Edge& edge) const { return depth_ == 0; }
/// informs this Pool that the given edge is committed to be run.
/// Pool will count this edge as using resources from this pool.
- void EdgeScheduled(Edge* edge);
+ void EdgeScheduled(const Edge& edge);
/// informs this Pool that the given edge is no longer runnable, and should
/// relinquish it's resources back to the pool
- void EdgeFinished(Edge* edge);
+ void EdgeFinished(const Edge& edge);
/// adds the given edge to this Pool to be delayed.
void DelayEdge(Edge* edge);
/// Pool will add zero or more edges to the ready_queue
- void RetrieveReadyEdges(Edge* edge, set<Edge*>* ready_queue);
+ void RetrieveReadyEdges(set<Edge*>* ready_queue);
private:
+ int UnitsWaiting() { return delayed_.size(); }
+
string name_;
int current_use_;