231 |
|
* }}</pre> |
232 |
|
* |
233 |
|
* In this example, as well as others in which tasks have no other |
234 |
< |
* effects except to compareAndSet a common result, the trailing |
235 |
< |
* unconditional invocation of {@code tryComplete} could be made |
236 |
< |
* conditional ({@code if (result.get() == null) tryComplete();}) |
234 |
> |
* effects except to {@code compareAndSet} a common result, the |
235 |
> |
* trailing unconditional invocation of {@code tryComplete} could be |
236 |
> |
* made conditional ({@code if (result.get() == null) tryComplete();}) |
237 |
|
* because no further bookkeeping is required to manage completions |
238 |
|
* once the root task completes. |
239 |
|
* |
610 |
|
|
611 |
|
/** |
612 |
|
* If this task's pending count is zero, returns this task; |
613 |
< |
* otherwise decrements its pending count and returns {@code |
614 |
< |
* null}. This method is designed to be used with {@link |
615 |
< |
* #nextComplete} in completion traversal loops. |
613 |
> |
* otherwise decrements its pending count and returns {@code null}. |
614 |
> |
* This method is designed to be used with {@link #nextComplete} in |
615 |
> |
* completion traversal loops. |
616 |
|
* |
617 |
|
* @return this task, if pending count was zero, else {@code null} |
618 |
|
*/ |