mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-28 07:14:30 +02:00
8274349: ForkJoinPool.commonPool() does not work with 1 CPU
Co-authored-by: Doug Lea <dl@openjdk.org> Reviewed-by: shade, martin
This commit is contained in:
parent
7e757f6a2c
commit
2e542e33b8
3 changed files with 84 additions and 4 deletions
|
@ -2561,7 +2561,7 @@ public class ForkJoinPool extends AbstractExecutorService {
|
|||
* overridden by system properties
|
||||
*/
|
||||
private ForkJoinPool(byte forCommonPoolOnly) {
|
||||
int parallelism = Runtime.getRuntime().availableProcessors() - 1;
|
||||
int parallelism = Math.max(1, Runtime.getRuntime().availableProcessors() - 1);
|
||||
ForkJoinWorkerThreadFactory fac = null;
|
||||
UncaughtExceptionHandler handler = null;
|
||||
try { // ignore exceptions in accessing/parsing properties
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue