Sets the result on the Task if the Task hasn't already been completed.
(TResult result)
| 583 | * Sets the result on the Task if the Task hasn't already been completed. |
| 584 | */ |
| 585 | public boolean trySetResult(TResult result) { |
| 586 | synchronized (lock) { |
| 587 | if (complete) { |
| 588 | return false; |
| 589 | } |
| 590 | complete = true; |
| 591 | Task.this.result = result; |
| 592 | lock.notifyAll(); |
| 593 | runContinuations(); |
| 594 | return true; |
| 595 | } |
| 596 | } |
| 597 | |
| 598 | /** |
| 599 | * Sets the error on the Task if the Task hasn't already been completed. |
no test coverage detected