343 |
|
// Constructors |
344 |
|
|
345 |
|
/** |
346 |
< |
* Creates a ForkJoinPool with a pool size equal to the number of |
347 |
< |
* processors available on the system, using the default |
348 |
< |
* ForkJoinWorkerThreadFactory. |
346 |
> |
* Creates a {@code ForkJoinPool} with a pool size equal to the |
347 |
> |
* number of processors available on the system, using the |
348 |
> |
* {@linkplain #defaultForkJoinWorkerThreadFactory default thread factory}. |
349 |
|
* |
350 |
|
* @throws SecurityException if a security manager exists and |
351 |
|
* the caller is not permitted to modify threads |
358 |
|
} |
359 |
|
|
360 |
|
/** |
361 |
< |
* Creates a ForkJoinPool with the indicated parallelism level |
362 |
< |
* threads and using the default ForkJoinWorkerThreadFactory. |
361 |
> |
* Creates a {@code ForkJoinPool} with the indicated parallelism level |
362 |
> |
* threads and using the |
363 |
> |
* {@linkplain #defaultForkJoinWorkerThreadFactory default thread factory}. |
364 |
|
* |
365 |
|
* @param parallelism the number of worker threads |
366 |
|
* @throws IllegalArgumentException if parallelism less than or |
375 |
|
} |
376 |
|
|
377 |
|
/** |
378 |
< |
* Creates a ForkJoinPool with parallelism equal to the number of |
379 |
< |
* processors available on the system and using the given |
380 |
< |
* ForkJoinWorkerThreadFactory. |
378 |
> |
* Creates a {@code ForkJoinPool} with parallelism equal to the |
379 |
> |
* number of processors available on the system and using the |
380 |
> |
* given thread factory. |
381 |
|
* |
382 |
|
* @param factory the factory for creating new threads |
383 |
|
* @throws NullPointerException if factory is null |
391 |
|
} |
392 |
|
|
393 |
|
/** |
394 |
< |
* Creates a ForkJoinPool with the given parallelism and factory. |
394 |
> |
* Creates a {@code ForkJoinPool} with the given parallelism and |
395 |
> |
* thread factory. |
396 |
|
* |
397 |
|
* @param parallelism the targeted number of worker threads |
398 |
|
* @param factory the factory for creating new threads |
426 |
|
* Creates a new worker thread using factory. |
427 |
|
* |
428 |
|
* @param index the index to assign worker |
429 |
< |
* @return new worker, or null of factory failed |
429 |
> |
* @return new worker, or null if factory failed |
430 |
|
*/ |
431 |
|
private ForkJoinWorkerThread createWorker(int index) { |
432 |
|
Thread.UncaughtExceptionHandler h = ueh; |
993 |
|
* Removes all available unexecuted submitted and forked tasks |
994 |
|
* from scheduling queues and adds them to the given collection, |
995 |
|
* without altering their execution status. These may include |
996 |
< |
* artificially generated or wrapped tasks. This method is designed |
997 |
< |
* to be invoked only when the pool is known to be |
996 |
> |
* artificially generated or wrapped tasks. This method is |
997 |
> |
* designed to be invoked only when the pool is known to be |
998 |
|
* quiescent. Invocations at other times may not remove all |
999 |
|
* tasks. A failure encountered while attempting to add elements |
1000 |
|
* to collection {@code c} may result in elements being in |