This commit is contained in:
Andrea Cavalli 2023-03-29 16:35:51 +02:00
parent 3180b751ef
commit f54388efa8
1 changed files with 2 additions and 2 deletions

View File

@ -59,13 +59,13 @@ public class StreamUtils {
private static final Function<Object, Void> FINISHER = x -> null;
private static final Collector<Long,?, Long> SUMMING_LONG_COLLECTOR = new SummingLongCollector();
public static ForkJoinPool newNamedForkJoinPool(String name, boolean fifo) {
public static ForkJoinPool newNamedForkJoinPool(String name, boolean async) {
final int MAX_CAP = 0x7fff; // max #workers - 1
return new ForkJoinPool(
Math.min(MAX_CAP, Runtime.getRuntime().availableProcessors()),
new NamedForkJoinWorkerThreadFactory(name),
null,
fifo,
async,
0,
MAX_CAP,
1,