153 |
|
|
154 |
|
/** |
155 |
|
* The uncaught exception handler used when any worker |
156 |
< |
* abrupty terminates |
156 |
> |
* abruptly terminates |
157 |
|
*/ |
158 |
|
private Thread.UncaughtExceptionHandler ueh; |
159 |
|
|
341 |
|
} |
342 |
|
|
343 |
|
/** |
344 |
< |
* Creates a ForkJoinPool with the indicated parellelism level |
344 |
> |
* Creates a ForkJoinPool with the indicated parallelism level |
345 |
|
* threads, and using the default ForkJoinWorkerThreadFactory, |
346 |
|
* @param parallelism the number of worker threads |
347 |
|
* @throws IllegalArgumentException if parallelism less than or |
430 |
|
|
431 |
|
/** |
432 |
|
* Create or resize array if necessary to hold newLength. |
433 |
< |
* Call only under exlusion or lock |
433 |
> |
* Call only under exclusion or lock |
434 |
|
* @return the array |
435 |
|
*/ |
436 |
|
private ForkJoinWorkerThread[] ensureWorkerArrayCapacity(int newLength) { |
716 |
|
|
717 |
|
|
718 |
|
/** |
719 |
< |
* Sets the target paralleism level of this pool. |
719 |
> |
* Sets the target parallelism level of this pool. |
720 |
|
* @param parallelism the target parallelism |
721 |
|
* @throws IllegalArgumentException if parallelism less than or |
722 |
|
* equal to zero or greater than maximum size bounds. |
819 |
|
* worker threads only process asynchronous tasks. This method is |
820 |
|
* designed to be invoked only when pool is quiescent, and |
821 |
|
* typically only before any tasks are submitted. The effects of |
822 |
< |
* invocations at ather times may be unpredictable. |
822 |
> |
* invocations at other times may be unpredictable. |
823 |
|
* |
824 |
|
* @param async if true, use locally FIFO scheduling |
825 |
|
* @return the previous mode. |
973 |
|
* Removes all available unexecuted submitted and forked tasks |
974 |
|
* from scheduling queues and adds them to the given collection, |
975 |
|
* without altering their execution status. These may include |
976 |
< |
* artifically generated or wrapped tasks. This method id designed |
976 |
> |
* artificially generated or wrapped tasks. This method is designed |
977 |
|
* to be invoked only when the pool is known to be |
978 |
|
* quiescent. Invocations at other times may not remove all |
979 |
|
* tasks. A failure encountered while attempting to add elements |
1478 |
|
* only be suspended or removed when they are idle, not |
1479 |
|
* immediately when they aren't needed. So adding threads will |
1480 |
|
* raise parallelism level for longer than necessary. Also, |
1481 |
< |
* FJ applications often enounter highly transient peaks when |
1481 |
> |
* FJ applications often encounter highly transient peaks when |
1482 |
|
* many threads are blocked joining, but for less time than it |
1483 |
|
* takes to create or resume spares. |
1484 |
|
* |
1582 |
|
} |
1583 |
|
|
1584 |
|
/** |
1585 |
< |
* Add the kth spare worker. On entry, pool coounts are already |
1585 |
> |
* Add the kth spare worker. On entry, pool counts are already |
1586 |
|
* adjusted to reflect addition. |
1587 |
|
*/ |
1588 |
|
private void createAndStartSpare(int k) { |
1719 |
|
* @return true if no additional blocking is necessary (i.e., |
1720 |
|
* if isReleasable would return true). |
1721 |
|
* @throws InterruptedException if interrupted while waiting |
1722 |
< |
* (the method is not required to do so, but is allowe to). |
1722 |
> |
* (the method is not required to do so, but is allowed to). |
1723 |
|
*/ |
1724 |
|
boolean block() throws InterruptedException; |
1725 |
|
|