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.*; |
147 |
|
} |
148 |
|
|
149 |
|
static void runWork(Job[] jobs, int minIters, int maxIters, long timeLimit) throws Throwable { |
150 |
< |
for (int k = 0; k < nsizes; ++k) { |
150 |
> |
for (int k = 0; k < nsizes; ++k) { |
151 |
|
int len = sizes[k]; |
152 |
|
for (int i = 0; i < jobs.length; i++) { |
153 |
|
Thread.sleep(50); |
160 |
|
|
161 |
|
// First warmup -- run only mixed job to discourage type specialization |
162 |
|
static void warmup1(Job job) throws Throwable { |
163 |
< |
for (int k = 0; k < nsizes; ++k) |
163 |
> |
for (int k = 0; k < nsizes; ++k) |
164 |
|
job.work(sizes[k], 1, 1, 0); |
165 |
|
} |
166 |
|
|
334 |
|
if (m.put(x, x) == null) |
335 |
|
++sum; |
336 |
|
} |
337 |
+ |
/* // uncomment to avoid calling clear() |
338 |
+ |
for (int i = 0; i < len; ++i) { |
339 |
+ |
Object x = keys[i]; |
340 |
+ |
m.remove(x); |
341 |
+ |
} |
342 |
+ |
*/ |
343 |
|
m.clear(); |
344 |
|
sum += len - (quarter * 2); |
345 |
|
checkSum += sum ^ (sum << 12); |
383 |
|
|
384 |
|
// plain array shuffle |
385 |
|
static void shuffle(Object[] a, int size) { |
386 |
< |
for (int i= size; i>1; i--) { |
386 |
> |
for (int i = size; i > 1; i--) { |
387 |
|
Object t = a[i-1]; |
388 |
|
int r = rng.nextInt(i); |
389 |
|
a[i-1] = a[r]; |
444 |
|
|
445 |
|
BufferedInputStream in = new BufferedInputStream(fr); |
446 |
|
int k = 0; |
447 |
< |
outer:while (k < n) { |
447 |
> |
outer: while (k < n) { |
448 |
|
StringBuffer sb = new StringBuffer(); |
449 |
|
for (;;) { |
450 |
|
int c = in.read(); |