diff options
author | Evan Martin <martine@danga.com> | 2012-04-28 17:56:38 (GMT) |
---|---|---|
committer | Evan Martin <martine@danga.com> | 2012-04-28 17:56:38 (GMT) |
commit | 3e9cb5d72ae6ea6faab4b7bdb7781d130590e799 (patch) | |
tree | 441e526ad70f5c6c8e8afedb8fc50ed9981c6589 /src/build.cc | |
parent | 8066c2d1bb5821077450755d774121e0205cb790 (diff) | |
parent | b50f7d1f30991998564f62aa717862efb7555044 (diff) | |
download | Ninja-3e9cb5d72ae6ea6faab4b7bdb7781d130590e799.zip Ninja-3e9cb5d72ae6ea6faab4b7bdb7781d130590e799.tar.gz Ninja-3e9cb5d72ae6ea6faab4b7bdb7781d130590e799.tar.bz2 |
Merge pull request #274 from polrop/max_load_average
Max load average
Diffstat (limited to 'src/build.cc')
-rw-r--r-- | src/build.cc | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/build.cc b/src/build.cc index a9e1e56..03a9d0d 100644 --- a/src/build.cc +++ b/src/build.cc @@ -474,7 +474,9 @@ void RealCommandRunner::Abort() { } bool RealCommandRunner::CanRunMore() { - return ((int)subprocs_.running_.size()) < config_.parallelism; + return ((int)subprocs_.running_.size()) < config_.parallelism + && ((subprocs_.running_.size() == 0 || config_.max_load_average <= 0.0f) + || GetLoadAverage() < config_.max_load_average); } bool RealCommandRunner::StartCommand(Edge* edge) { |