4 |
|
* http://creativecommons.org/publicdomain/zero/1.0/ |
5 |
|
*/ |
6 |
|
|
7 |
< |
import junit.framework.*; |
8 |
< |
import java.util.concurrent.*; |
7 |
> |
import java.util.concurrent.Executors; |
8 |
> |
import java.util.concurrent.ExecutorService; |
9 |
> |
import java.util.concurrent.Phaser; |
10 |
|
import java.util.concurrent.atomic.LongAccumulator; |
11 |
|
|
12 |
+ |
import junit.framework.Test; |
13 |
+ |
import junit.framework.TestSuite; |
14 |
+ |
|
15 |
|
public class LongAccumulatorTest extends JSR166TestCase { |
16 |
|
public static void main(String[] args) { |
17 |
|
junit.textui.TestRunner.run(suite()); |
132 |
|
pool.shutdown(); |
133 |
|
} |
134 |
|
|
135 |
< |
static final class AccTask implements Runnable { |
135 |
> |
static final class AccTask implements Runnable { |
136 |
|
final LongAccumulator acc; |
137 |
|
final Phaser phaser; |
138 |
|
final int incs; |
139 |
|
volatile long result; |
140 |
< |
AccTask(LongAccumulator acc, Phaser phaser, int incs) { |
141 |
< |
this.acc = acc; |
140 |
> |
AccTask(LongAccumulator acc, Phaser phaser, int incs) { |
141 |
> |
this.acc = acc; |
142 |
|
this.phaser = phaser; |
143 |
|
this.incs = incs; |
144 |
|
} |