584 |
|
} |
585 |
|
} |
586 |
|
|
587 |
+ |
static final boolean defaultExecutorIsCommonPool |
588 |
+ |
= ForkJoinPool.getCommonPoolParallelism() > 1; |
589 |
+ |
|
590 |
|
/** |
591 |
|
* Permits the testing of parallel code for the 3 different |
592 |
|
* execution modes without copy/pasting all the test methods. |
668 |
|
|
669 |
|
ASYNC { |
670 |
|
public void checkExecutionMode() { |
671 |
< |
assertSame(ForkJoinPool.commonPool(), |
672 |
< |
ForkJoinTask.getPool()); |
671 |
> |
assertEquals(defaultExecutorIsCommonPool, |
672 |
> |
(ForkJoinPool.commonPool() == ForkJoinTask.getPool())); |
673 |
|
} |
674 |
|
public CompletableFuture<Void> runAsync(Runnable a) { |
675 |
|
return CompletableFuture.runAsync(a); |