11 |
|
import java.util.Collection; |
12 |
|
import java.util.Collections; |
13 |
|
import java.util.List; |
14 |
+ |
import java.util.concurrent.AbstractExecutorService; |
15 |
+ |
import java.util.concurrent.Callable; |
16 |
+ |
import java.util.concurrent.CountDownLatch; |
17 |
+ |
import java.util.concurrent.ExecutorService; |
18 |
+ |
import java.util.concurrent.Future; |
19 |
+ |
import java.util.concurrent.RejectedExecutionException; |
20 |
+ |
import java.util.concurrent.RunnableFuture; |
21 |
+ |
import java.util.concurrent.TimeUnit; |
22 |
+ |
import java.util.concurrent.TimeoutException; |
23 |
+ |
import java.util.concurrent.atomic.AtomicInteger; |
24 |
|
import java.util.concurrent.locks.LockSupport; |
25 |
|
import java.util.concurrent.locks.ReentrantLock; |
16 |
– |
import java.util.concurrent.atomic.AtomicInteger; |
17 |
– |
import java.util.concurrent.CountDownLatch; |
26 |
|
|
27 |
|
/** |
28 |
|
* An {@link ExecutorService} for running {@link ForkJoinTask}s. |
523 |
|
* Lifecycle control. The low word contains the number of workers |
524 |
|
* that are (probably) executing tasks. This value is atomically |
525 |
|
* incremented before a worker gets a task to run, and decremented |
526 |
< |
* when worker has no tasks and cannot find any. Bits 16-18 |
526 |
> |
* when a worker has no tasks and cannot find any. Bits 16-18 |
527 |
|
* contain runLevel value. When all are zero, the pool is |
528 |
|
* running. Level transitions are monotonic (running -> shutdown |
529 |
|
* -> terminating -> terminated) so each transition adds a bit. |