842 |
|
} |
843 |
|
|
844 |
|
/** |
845 |
< |
* Returns {@code true} if the current thread is executing as a |
846 |
< |
* ForkJoinPool computation. |
845 |
> |
* Returns {@code true} if the current thread is a {@link |
846 |
> |
* ForkJoinWorkerThread} executing as a ForkJoinPool computation. |
847 |
|
* |
848 |
< |
* @return {@code true} if the current thread is executing as a |
849 |
< |
* ForkJoinPool computation, or false otherwise |
848 |
> |
* @return {@code true} if the current thread is a {@link |
849 |
> |
* ForkJoinWorkerThread} executing as a ForkJoinPool computation, |
850 |
> |
* or {@code false} otherwise |
851 |
|
*/ |
852 |
|
public static boolean inForkJoinPool() { |
853 |
|
return Thread.currentThread() instanceof ForkJoinWorkerThread; |