18 |
|
import java.util.concurrent.Future; |
19 |
|
import java.util.concurrent.RejectedExecutionException; |
20 |
|
import java.util.concurrent.RunnableFuture; |
21 |
– |
import java.util.concurrent.ThreadLocalRandom; |
21 |
|
import java.util.concurrent.TimeUnit; |
22 |
|
|
23 |
|
/** |
530 |
|
* Returns a new worker thread operating in the given pool. |
531 |
|
* |
532 |
|
* @param pool the pool this thread works in |
534 |
– |
* @throws NullPointerException if the pool is null |
533 |
|
* @return the new worker thread |
534 |
+ |
* @throws NullPointerException if the pool is null |
535 |
|
*/ |
536 |
|
public ForkJoinWorkerThread newThread(ForkJoinPool pool); |
537 |
|
} |
2096 |
|
w.currentSteal = ps; |
2097 |
|
} |
2098 |
|
} |
2099 |
< |
else if (active) { // decrement active count without queuing |
2099 |
> |
else if (active) { // decrement active count without queuing |
2100 |
|
long nc = ((c = ctl) & ~AC_MASK) | ((c & AC_MASK) - AC_UNIT); |
2101 |
|
if ((int)(nc >> AC_SHIFT) + parallelism == 0) |
2102 |
|
break; // bypass decrement-then-increment |
2495 |
|
* minimally only the latter. |
2496 |
|
* |
2497 |
|
* @param task the task |
2498 |
+ |
* @param <T> the type of the task's result |
2499 |
|
* @return the task's result |
2500 |
|
* @throws NullPointerException if the task is null |
2501 |
|
* @throws RejectedExecutionException if the task cannot be |
2544 |
|
* Submits a ForkJoinTask for execution. |
2545 |
|
* |
2546 |
|
* @param task the task to submit |
2547 |
+ |
* @param <T> the type of the task's result |
2548 |
|
* @return the task |
2549 |
|
* @throws NullPointerException if the task is null |
2550 |
|
* @throws RejectedExecutionException if the task cannot be |