137 |
|
* using a factory that may return {@code null}. However doing so may |
138 |
|
* cause unjoined tasks to never be executed. |
139 |
|
* |
140 |
< |
* <p><b>Implementation notes:</b> This implementation restricts the |
141 |
< |
* maximum number of running threads to 32767. Attempts to create |
142 |
< |
* pools with greater than the maximum number result in |
143 |
< |
* {@code IllegalArgumentException}. |
144 |
< |
* |
145 |
< |
* <p>This implementation rejects submitted tasks (that is, by throwing |
146 |
< |
* {@link RejectedExecutionException}) only when the pool is shut down |
147 |
< |
* or internal resources have been exhausted. |
140 |
> |
* @implNote This implementation restricts the maximum number of |
141 |
> |
* running threads to 32767. Attempts to create pools with greater |
142 |
> |
* than the maximum number result in {@code |
143 |
> |
* IllegalArgumentException}. Also, this implementation rejects |
144 |
> |
* submitted tasks (that is, by throwing {@link |
145 |
> |
* RejectedExecutionException}) only when the pool is shut down or |
146 |
> |
* internal resources have been exhausted. |
147 |
|
* |
148 |
|
* @since 1.7 |
149 |
|
* @author Doug Lea |
2891 |
|
* Applications include contexts in which the number of available |
2892 |
|
* processors changes over time. |
2893 |
|
* |
2894 |
+ |
* @implNote This implementation restricts the maximum number of |
2895 |
+ |
* running threads to 32767 |
2896 |
+ |
* |
2897 |
|
* @param size the target parallelism level |
2898 |
|
* @return the previous parallelism level. |
2899 |
|
* @throws IllegalArgumentException if size is less than 1 or |
2900 |
< |
* greater than the maximum supported by this |
2899 |
< |
* pool (currently 32767). |
2900 |
> |
* greater than the maximum supported by this pool. |
2901 |
|
* @throws IllegalStateException if this is the{@link #commonPool()} and |
2902 |
|
* parallelism level was set by System property |
2903 |
|
* {@systemProperty java.util.concurrent.ForkJoinPool.common.parallelism}. |