Always use a thread pool of at least size 1.

Fixes #161.
This commit is contained in:
Michael Bayne
2018-11-19 19:36:13 -08:00
parent 3b888a72b7
commit df2ff3fddb
@@ -110,7 +110,8 @@ public class SysProps
/** Returns the number of threads used to perform digesting and verifying operations in
* parallel. Usage: {@code -Dthread_pool_size=N} */
public static int threadPoolSize () {
return Integer.getInteger("thread_pool_size", Runtime.getRuntime().availableProcessors()-1);
int defaultSize = Math.max(Runtime.getRuntime().availableProcessors()-1, 1);
return Integer.getInteger("thread_pool_size", defaultSize);
}
/** Parses a Java version system property using the supplied regular expression. The numbers