126 |
|
|
127 |
|
{ |
128 |
|
Thread.currentThread().interrupt(); |
129 |
< |
long t0 = System.nanoTime(); |
129 |
> |
long startTime = System.nanoTime(); |
130 |
|
assertSame(expected, a.join()); |
131 |
< |
assertTrue(millisElapsedSince(t0) < SMALL_DELAY_MS); |
131 |
> |
assertTrue(millisElapsedSince(startTime) < SMALL_DELAY_MS); |
132 |
|
Thread.interrupted(); |
133 |
|
} |
134 |
|
|
135 |
|
{ |
136 |
|
Thread.currentThread().interrupt(); |
137 |
< |
long t0 = System.nanoTime(); |
137 |
> |
long startTime = System.nanoTime(); |
138 |
|
a.quietlyJoin(); // should be no-op |
139 |
< |
assertTrue(millisElapsedSince(t0) < SMALL_DELAY_MS); |
139 |
> |
assertTrue(millisElapsedSince(startTime) < SMALL_DELAY_MS); |
140 |
|
Thread.interrupted(); |
141 |
|
} |
142 |
|
|
172 |
|
Thread.interrupted(); |
173 |
|
|
174 |
|
{ |
175 |
< |
long t0 = System.nanoTime(); |
175 |
> |
long startTime = System.nanoTime(); |
176 |
|
a.quietlyJoin(); // should be no-op |
177 |
< |
assertTrue(millisElapsedSince(t0) < SMALL_DELAY_MS); |
177 |
> |
assertTrue(millisElapsedSince(startTime) < SMALL_DELAY_MS); |
178 |
|
} |
179 |
|
|
180 |
|
try { |
1163 |
|
final ForkJoinTask b = ForkJoinTask.adapt(awaiter(done)); |
1164 |
|
final ForkJoinTask c = ForkJoinTask.adapt(awaiter(done)); |
1165 |
|
final ForkJoinPool p = singletonPool(); |
1166 |
< |
try (PoolCleaner cleaner = cleaner(p)) { |
1166 |
> |
try (PoolCleaner cleaner = cleaner(p, done)) { |
1167 |
|
Thread external = new Thread(new CheckedRunnable() { |
1168 |
|
public void realRun() { |
1169 |
|
p.execute(a); |
1185 |
|
assertFalse(r.isDone()); |
1186 |
|
}}; |
1187 |
|
p.invoke(s); |
1188 |
– |
done.countDown(); |
1188 |
|
} |
1189 |
|
} |
1190 |
|
|