projects
/
platform
/
upstream
/
ninja.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
0d6a4e9
)
Throttle the number of pending commands by the parallelism configuration
author
tzik
<tzik@chromium.org>
Fri, 19 Sep 2014 08:07:29 +0000
(17:07 +0900)
committer
tzik
<tzik@chromium.org>
Mon, 22 Sep 2014 04:03:31 +0000
(13:03 +0900)
src/build.cc
patch
|
blob
|
history
diff --git
a/src/build.cc
b/src/build.cc
index
64bcea3
..
fb1cc74
100644
(file)
--- a/
src/build.cc
+++ b/
src/build.cc
@@
-488,7
+488,9
@@
void RealCommandRunner::Abort() {
}
bool RealCommandRunner::CanRunMore() {
- return ((int)subprocs_.running_.size()) < config_.parallelism
+ size_t subproc_number =
+ subprocs_.running_.size() + subprocs_.finished_.size();
+ return (int)subproc_number < config_.parallelism
&& ((subprocs_.running_.empty() || config_.max_load_average <= 0.0f)
|| GetLoadAverage() < config_.max_load_average);
}