806 |
|
// Maintaining parallelism |
807 |
|
|
808 |
|
/** |
809 |
< |
* Pushes worker onto the spare stack |
809 |
> |
* Pushes worker onto the spare stack. |
810 |
|
*/ |
811 |
|
final void pushSpare(ForkJoinWorkerThread w) { |
812 |
|
int ns = (++w.spareCount << SPARE_COUNT_SHIFT) | (w.poolIndex + 1); |
1225 |
|
* use {@link #defaultForkJoinWorkerThreadFactory}. |
1226 |
|
* @param handler the handler for internal worker threads that |
1227 |
|
* terminate due to unrecoverable errors encountered while executing |
1228 |
< |
* tasks. For default value, use <code>null</code>. |
1228 |
> |
* tasks. For default value, use {@code null}. |
1229 |
|
* @param asyncMode if true, |
1230 |
|
* establishes local first-in-first-out scheduling mode for forked |
1231 |
|
* tasks that are never joined. This mode may be more appropriate |
1232 |
|
* than default locally stack-based mode in applications in which |
1233 |
|
* worker threads only process event-style asynchronous tasks. |
1234 |
< |
* For default value, use <code>false</code>. |
1234 |
> |
* For default value, use {@code false}. |
1235 |
|
* @throws IllegalArgumentException if parallelism less than or |
1236 |
|
* equal to zero, or greater than implementation limit |
1237 |
|
* @throws NullPointerException if the factory is null |
1842 |
|
private static final long eventCountOffset = |
1843 |
|
objectFieldOffset("eventCount", ForkJoinPool.class); |
1844 |
|
private static final long eventWaitersOffset = |
1845 |
< |
objectFieldOffset("eventWaiters",ForkJoinPool.class); |
1845 |
> |
objectFieldOffset("eventWaiters", ForkJoinPool.class); |
1846 |
|
private static final long stealCountOffset = |
1847 |
< |
objectFieldOffset("stealCount",ForkJoinPool.class); |
1847 |
> |
objectFieldOffset("stealCount", ForkJoinPool.class); |
1848 |
|
private static final long spareWaitersOffset = |
1849 |
< |
objectFieldOffset("spareWaiters",ForkJoinPool.class); |
1849 |
> |
objectFieldOffset("spareWaiters", ForkJoinPool.class); |
1850 |
|
|
1851 |
|
private static long objectFieldOffset(String field, Class<?> klazz) { |
1852 |
|
try { |