summaryrefslogtreecommitdiffstats
path: root/src/build.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/build.cc')
-rw-r--r--src/build.cc4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/build.cc b/src/build.cc
index 6063cec..a269e50 100644
--- a/src/build.cc
+++ b/src/build.cc
@@ -452,7 +452,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) {