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; |
958 |
|
} |
959 |
|
|
960 |
|
/** |
961 |
< |
* Returns an estimate of the number tasks submitted to this pool |
962 |
< |
* that have not yet begun executing. This method takes time |
961 |
> |
* Returns an estimate of the number of tasks submitted to this |
962 |
> |
* pool that have not yet begun executing. This method takes time |
963 |
|
* proportional to the number of submissions. |
964 |
|
* |
965 |
|
* @return the number of queued submissions |
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 |
1744 |
|
* Method {@code isReleasable} must return {@code true} if |
1745 |
|
* blocking is not necessary. Method {@code block} blocks the |
1746 |
|
* current thread if necessary (perhaps internally invoking |
1747 |
< |
* {@code isReleasable} before actually blocking.). |
1747 |
> |
* {@code isReleasable} before actually blocking). |
1748 |
|
* |
1749 |
|
* <p>For example, here is a ManagedBlocker based on a |
1750 |
|
* ReentrantLock: |