81 |
|
private static final int MAX_THREADS = 0x7FFF; |
82 |
|
|
83 |
|
/** |
84 |
< |
* Factory for creating new ForkJoinWorkerThreads. A |
85 |
< |
* ForkJoinWorkerThreadFactory must be defined and used for |
86 |
< |
* ForkJoinWorkerThread subclasses that extend base functionality |
87 |
< |
* or initialize threads with different contexts. |
84 |
> |
* Factory for creating new {@link ForkJoinWorkerThread}s. |
85 |
> |
* A {@code ForkJoinWorkerThreadFactory} must be defined and used |
86 |
> |
* for {@code ForkJoinWorkerThread} subclasses that extend base |
87 |
> |
* functionality or initialize threads with different contexts. |
88 |
|
*/ |
89 |
|
public static interface ForkJoinWorkerThreadFactory { |
90 |
|
/** |
787 |
|
* Setting this value has no effect on current pool size. It |
788 |
|
* controls construction of new threads. |
789 |
|
* |
790 |
< |
* @throws IllegalArgumentException if negative or greater then |
790 |
> |
* @throws IllegalArgumentException if negative or greater than |
791 |
|
* internal implementation limit |
792 |
|
*/ |
793 |
|
public void setMaximumPoolSize(int newMax) { |
1735 |
|
|
1736 |
|
/** |
1737 |
|
* Interface for extending managed parallelism for tasks running |
1738 |
< |
* in ForkJoinPools. A ManagedBlocker provides two methods. |
1738 |
> |
* in {@link ForkJoinPool}s. |
1739 |
> |
* |
1740 |
> |
* <p>A {@code ManagedBlocker} provides two methods. |
1741 |
|
* Method {@code isReleasable} must return {@code true} if |
1742 |
|
* blocking is not necessary. Method {@code block} blocks the |
1743 |
|
* current thread if necessary (perhaps internally invoking |
1835 |
|
// implement RunnableFuture. |
1836 |
|
|
1837 |
|
protected <T> RunnableFuture<T> newTaskFor(Runnable runnable, T value) { |
1838 |
< |
return (RunnableFuture<T>)ForkJoinTask.adapt(runnable, value); |
1838 |
> |
return (RunnableFuture<T>) ForkJoinTask.adapt(runnable, value); |
1839 |
|
} |
1840 |
|
|
1841 |
|
protected <T> RunnableFuture<T> newTaskFor(Callable<T> callable) { |
1842 |
< |
return (RunnableFuture<T>)ForkJoinTask.adapt(callable); |
1842 |
> |
return (RunnableFuture<T>) ForkJoinTask.adapt(callable); |
1843 |
|
} |
1844 |
|
|
1845 |
|
// Unsafe mechanics |