32 |
|
static final short INITIAL_STATE = -1; |
33 |
|
static final short COMPLETE_STATE = 0; |
34 |
|
static final short EXCEPTION_STATE = 1; |
35 |
– |
|
35 |
|
|
36 |
|
public static void main(String[] args) { |
37 |
|
junit.textui.TestRunner.run(suite()); |
205 |
|
} |
206 |
|
|
207 |
|
protected void onComplete(BinaryAsyncAction x, BinaryAsyncAction y) { |
208 |
< |
if (this.getForkJoinTaskTag() != COMPLETE_STATE || |
209 |
< |
x.getForkJoinTaskTag() != COMPLETE_STATE || |
208 |
> |
if (this.getForkJoinTaskTag() != COMPLETE_STATE || |
209 |
> |
x.getForkJoinTaskTag() != COMPLETE_STATE || |
210 |
|
y.getForkJoinTaskTag() != COMPLETE_STATE) { |
211 |
|
completeThisExceptionally(new FJException()); |
212 |
|
} |
240 |
|
a.sibling = null; |
241 |
|
a.parent = null; |
242 |
|
a.completeThis(); |
243 |
< |
if (p == null || |
243 |
> |
if (p == null || |
244 |
|
p.compareAndSetForkJoinTaskTag(INITIAL_STATE, COMPLETE_STATE)) |
245 |
|
break; |
246 |
|
try { |
278 |
|
super.reinitialize(); |
279 |
|
} |
280 |
|
|
282 |
– |
|
281 |
|
} |
282 |
|
|
283 |
|
static final class AsyncFib extends BinaryAsyncAction { |
302 |
|
} |
303 |
|
f.complete(); |
304 |
|
} |
305 |
< |
catch(Throwable ex) { |
305 |
> |
catch (Throwable ex) { |
306 |
|
compareAndSetForkJoinTaskTag(INITIAL_STATE, EXCEPTION_STATE); |
307 |
|
} |
308 |
|
return false; |
571 |
|
testInvokeOnPool(mainPool(), a); |
572 |
|
} |
573 |
|
|
576 |
– |
|
574 |
|
/** |
575 |
|
* getPool of executing task returns its pool |
576 |
|
*/ |
793 |
|
} |
794 |
|
|
795 |
|
/** |
796 |
< |
* invokeAll(collection) throws exception if any task does |
796 |
> |
* invokeAll(collection) throws exception if any task does |
797 |
|
*/ |
798 |
|
public void testAbnormalInvokeAllCollection() { |
799 |
|
RecursiveAction a = new CheckedRecursiveAction() { |
1370 |
|
} |
1371 |
|
|
1372 |
|
/** |
1373 |
< |
* invokeAll(collection) throws exception if any task does |
1373 |
> |
* invokeAll(collection) throws exception if any task does |
1374 |
|
*/ |
1375 |
|
public void testAbnormalInvokeAllCollectionSingleton() { |
1376 |
|
RecursiveAction a = new CheckedRecursiveAction() { |
1392 |
|
testInvokeOnPool(singletonPool(), a); |
1393 |
|
} |
1394 |
|
|
1398 |
– |
|
1395 |
|
/** |
1396 |
|
* ForkJoinTask.quietlyComplete returns when task completes |
1397 |
|
* normally without setting a value. The most recent value |