619 |
|
|
620 |
|
/** |
621 |
|
* Completes this task, and if not already aborted or cancelled, |
622 |
< |
* returning a {@code null} result upon {@code join} and related |
623 |
< |
* operations. This method may be used to provide results for |
624 |
< |
* asynchronous tasks, or to provide alternative handling for |
625 |
< |
* tasks that would not otherwise complete normally. Its use in |
626 |
< |
* other situations is discouraged. This method is |
627 |
< |
* overridable, but overridden versions must invoke {@code super} |
628 |
< |
* implementation to maintain guarantees. |
622 |
> |
* returning the given value as the result of subsequent |
623 |
> |
* invocations of {@code join} and related operations. This method |
624 |
> |
* may be used to provide results for asynchronous tasks, or to |
625 |
> |
* provide alternative handling for tasks that would not otherwise |
626 |
> |
* complete normally. Its use in other situations is |
627 |
> |
* discouraged. This method is overridable, but overridden |
628 |
> |
* versions must invoke {@code super} implementation to maintain |
629 |
> |
* guarantees. |
630 |
|
* |
631 |
|
* @param value the result value for this task |
632 |
|
*/ |
678 |
|
boolean dec = false; // true if pool count decremented |
679 |
|
long nanos = unit.toNanos(timeout); |
680 |
|
for (;;) { |
681 |
< |
if (Thread.interrupted() && pool == null) { |
681 |
> |
if (pool == null && Thread.interrupted()) { |
682 |
|
interrupted = true; |
683 |
|
break; |
684 |
|
} |
763 |
|
/** |
764 |
|
* Commences performing this task and awaits its completion if |
765 |
|
* necessary, without returning its result or throwing its |
766 |
< |
* exception. This method may be useful when processing |
766 |
< |
* collections of tasks when some have been cancelled or otherwise |
767 |
< |
* known to have aborted. |
766 |
> |
* exception. |
767 |
|
*/ |
768 |
|
public final void quietlyInvoke() { |
769 |
|
if (status >= 0) { |