205 |
|
* Without precautions, CompletableFutures would be prone to |
206 |
|
* garbage accumulation as chains of Completions build up, each |
207 |
|
* pointing back to its sources. So we null out fields as soon as |
208 |
< |
* possible (see especially method Completion.detach). The |
209 |
< |
* screening checks needed anyway harmlessly ignore null arguments |
210 |
< |
* that may have been obtained during races with threads nulling |
211 |
< |
* out fields. We also try to unlink fired Completions from |
212 |
< |
* stacks that might never be popped (see method postFire). |
213 |
< |
* Completion fields need not be declared as final or volatile |
214 |
< |
* because they are only visible to other threads upon safe |
215 |
< |
* publication. |
208 |
> |
* possible. The screening checks needed anyway harmlessly ignore |
209 |
> |
* null arguments that may have been obtained during races with |
210 |
> |
* threads nulling out fields. We also try to unlink fired |
211 |
> |
* Completions from stacks that might never be popped (see method |
212 |
> |
* postFire). Completion fields need not be declared as final or |
213 |
> |
* volatile because they are only visible to other threads upon |
214 |
> |
* safe publication. |
215 |
|
*/ |
216 |
|
|
217 |
|
volatile Object result; // Either the result or boxed AltResult |