1 |
|
/* |
2 |
|
* Written by Doug Lea with assistance from members of JCP JSR-166 |
3 |
|
* Expert Group and released to the public domain, as explained at |
4 |
< |
* http://creativecommons.org/licenses/publicdomain |
4 |
> |
* http://creativecommons.org/publicdomain/zero/1.0/ |
5 |
|
*/ |
6 |
|
|
7 |
|
import java.util.*; |
54 |
|
i = k; |
55 |
|
} |
56 |
|
pool.shutdown(); |
57 |
< |
} |
57 |
> |
} |
58 |
|
|
59 |
|
static class Stage implements Callable<Integer> { |
60 |
|
final Deque<Integer> queue; |
61 |
|
final CyclicBarrier barrier; |
62 |
|
final LoopHelpers.SimpleRandom rng = new LoopHelpers.SimpleRandom(); |
63 |
|
int items; |
64 |
< |
Stage (Deque<Integer> q, CyclicBarrier b, int items) { |
64 |
> |
Stage(Deque<Integer> q, CyclicBarrier b, int items) { |
65 |
|
queue = q; |
66 |
|
barrier = b; |
67 |
|
this.items = items; |