()
| 325 | } |
| 326 | |
| 327 | @SuppressWarnings("unchecked") |
| 328 | private final Promise<T> compress() { |
| 329 | while (true) { |
| 330 | final Object curr = state; |
| 331 | if (curr instanceof Promise && !(curr instanceof Continuation)) { // Linked |
| 332 | final Promise<T> target = ((Promise<T>) curr).compress(); |
| 333 | if (curr == target || cas(curr, target)) |
| 334 | return target; |
| 335 | } else |
| 336 | return this; |
| 337 | } |
| 338 | } |
| 339 | |
| 340 | /** |
| 341 | * Completes this promise with value. |
no test coverage detected