1165 |
|
final ForkJoinTask b = ForkJoinTask.adapt(awaiter(done)); |
1166 |
|
final ForkJoinTask c = ForkJoinTask.adapt(awaiter(done)); |
1167 |
|
final ForkJoinPool p = singletonPool(); |
1168 |
< |
Thread external = new Thread() { |
1169 |
< |
public void run() { |
1170 |
< |
p.execute(a); |
1171 |
< |
p.execute(b); |
1172 |
< |
p.execute(c); |
1173 |
< |
}}; |
1168 |
> |
Thread external = new Thread(new CheckedRunnable() { |
1169 |
> |
public void realRun() { |
1170 |
> |
p.execute(a); |
1171 |
> |
p.execute(b); |
1172 |
> |
p.execute(c); |
1173 |
> |
}}); |
1174 |
|
RecursiveAction s = new CheckedRecursiveAction() { |
1175 |
< |
protected void realCompute() { |
1176 |
< |
external.start(); |
1177 |
< |
try { |
1178 |
< |
external.join(); |
1179 |
< |
} catch (Exception ex) { |
1180 |
< |
threadUnexpectedException(ex); |
1181 |
< |
} |
1182 |
< |
assertTrue(p.hasQueuedSubmissions()); |
1183 |
< |
assertTrue(Thread.currentThread() instanceof ForkJoinWorkerThread); |
1184 |
< |
ForkJoinTask r = ForkJoinTask.pollSubmission(); |
1185 |
< |
assertTrue(r == a || r == b || r == c); |
1186 |
< |
assertFalse(r.isDone()); |
1187 |
< |
}}; |
1175 |
> |
protected void realCompute() { |
1176 |
> |
external.start(); |
1177 |
> |
try { |
1178 |
> |
external.join(); |
1179 |
> |
} catch (Exception ex) { |
1180 |
> |
threadUnexpectedException(ex); |
1181 |
> |
} |
1182 |
> |
assertTrue(p.hasQueuedSubmissions()); |
1183 |
> |
assertTrue(Thread.currentThread() instanceof ForkJoinWorkerThread); |
1184 |
> |
ForkJoinTask r = ForkJoinTask.pollSubmission(); |
1185 |
> |
assertTrue(r == a || r == b || r == c); |
1186 |
> |
assertFalse(r.isDone()); |
1187 |
> |
}}; |
1188 |
|
try { |
1189 |
|
p.invoke(s); |
1190 |
|
} finally { |