set lower limit of 1 for max_worker_threads_count (for low-profile cpu)

This commit is contained in:
Eugene Zhuravlev
2013-11-27 16:10:21 +01:00
parent 6ccdae5a8c
commit b2bce83a38
@@ -85,10 +85,10 @@ public class IncProjectBuilder {
static {
int maxThreads = Math.min(6, Runtime.getRuntime().availableProcessors() - 1);
try {
maxThreads = Math.max(2, Integer.parseInt(System.getProperty(GlobalOptions.COMPILE_PARALLEL_MAX_THREADS_OPTION, Integer.toString(maxThreads))));
maxThreads = Math.max(1, Integer.parseInt(System.getProperty(GlobalOptions.COMPILE_PARALLEL_MAX_THREADS_OPTION, Integer.toString(maxThreads))));
}
catch (NumberFormatException ignored) {
maxThreads = Math.max(2, maxThreads);
maxThreads = Math.max(1, maxThreads);
}
MAX_BUILDER_THREADS = maxThreads;
}
@@ -569,7 +569,7 @@ public class IncProjectBuilder {
private void buildChunks(final CompileContextImpl context) throws ProjectBuildException {
try {
if (BuildRunner.PARALLEL_BUILD_ENABLED) {
if (BuildRunner.PARALLEL_BUILD_ENABLED && MAX_BUILDER_THREADS > 1) {
new BuildParallelizer(context).buildInParallel();
}
else {