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