308 |
|
|
309 |
|
/* ------------- Completions -------------- */ |
310 |
|
|
311 |
< |
static abstract class Completion<T> { // See above |
311 |
> |
abstract static class Completion<T> { // See above |
312 |
|
volatile Completion<?> next; // Treiber stack link |
313 |
|
|
314 |
|
/** |
353 |
|
* trigger. Fields can only be observed by other threads upon |
354 |
|
* successful push; and should be nulled out after claim. |
355 |
|
*/ |
356 |
< |
static abstract class UniCompletion<T> extends Completion<T> { |
356 |
> |
abstract static class UniCompletion<T> extends Completion<T> { |
357 |
|
Executor async; // executor to use (null if none) |
358 |
|
CompletableFuture<T> dep; // the dependent to complete |
359 |
|
CompletableFuture<?> src; // source of value for tryAct |
935 |
|
/* ------------- Two-source Completions -------------- */ |
936 |
|
|
937 |
|
/** A Completion with two sources */ |
938 |
< |
static abstract class BiCompletion<T> extends UniCompletion<T> { |
938 |
> |
abstract static class BiCompletion<T> extends UniCompletion<T> { |
939 |
|
CompletableFuture<?> snd; // second source for tryAct |
940 |
|
BiCompletion(Executor async, CompletableFuture<T> dep, |
941 |
|
CompletableFuture<?> src, CompletableFuture<?> snd) { |
1709 |
|
*/ |
1710 |
|
public T getNow(T valueIfAbsent) { |
1711 |
|
Object r; |
1712 |
< |
return (r = result) == null? valueIfAbsent : reportJoin(r); |
1712 |
> |
return ((r = result) == null) ? valueIfAbsent : reportJoin(r); |
1713 |
|
} |
1714 |
|
|
1715 |
|
/** |