Sets the result of this Future unless this Future has already been cancelled or set (including plain #setFuture set asynchronously). When a call to this method returns, the Future is guaranteed to be plain #isDone done only if the call was accepted (in wh
(@Nullable V value)
| 632 | */ |
| 633 | |
| 634 | @CanIgnoreReturnValue |
| 635 | protected boolean set(@Nullable V value) { |
| 636 | Object valueToSet = value == null ? NULL : value; |
| 637 | if (ATOMIC_HELPER.casValue(this, null, valueToSet)) { |
| 638 | complete(); |
| 639 | return true; |
| 640 | } |
| 641 | return false; |
| 642 | } |
| 643 | |
| 644 | /** |
| 645 | * Sets the failed result of this {@code Future} unless this {@code Future} has already been |