225 |
|
volatile Completion stack; // Top of Treiber stack of dependent actions |
226 |
|
|
227 |
|
final boolean internalComplete(Object r) { // CAS from null to r |
228 |
< |
return RESULT.compareAndSet(this, (Object)null, r); |
228 |
> |
return RESULT.compareAndSet(this, null, r); |
229 |
|
} |
230 |
|
|
231 |
|
/** Returns true if successfully pushed c onto stack. */ |
252 |
|
|
253 |
|
/** Completes with the null value, unless already completed. */ |
254 |
|
final boolean completeNull() { |
255 |
< |
return RESULT.compareAndSet(this, (Object)null, (Object)NIL); |
255 |
> |
return RESULT.compareAndSet(this, null, NIL); |
256 |
|
} |
257 |
|
|
258 |
|
/** Returns the encoding of the given non-exceptional value. */ |
262 |
|
|
263 |
|
/** Completes with a non-exceptional result, unless already completed. */ |
264 |
|
final boolean completeValue(T t) { |
265 |
< |
return RESULT.compareAndSet(this, (Object)null, (t == null) ? NIL : t); |
265 |
> |
return RESULT.compareAndSet(this, null, (t == null) ? NIL : t); |
266 |
|
} |
267 |
|
|
268 |
|
/** |
276 |
|
|
277 |
|
/** Completes with an exceptional result, unless already completed. */ |
278 |
|
final boolean completeThrowable(Throwable x) { |
279 |
< |
return RESULT.compareAndSet(this, (Object)null, encodeThrowable(x)); |
279 |
> |
return RESULT.compareAndSet(this, null, encodeThrowable(x)); |
280 |
|
} |
281 |
|
|
282 |
|
/** |
303 |
|
* existing CompletionException. |
304 |
|
*/ |
305 |
|
final boolean completeThrowable(Throwable x, Object r) { |
306 |
< |
return RESULT.compareAndSet(this, (Object)null, encodeThrowable(x, r)); |
306 |
> |
return RESULT.compareAndSet(this, null, encodeThrowable(x, r)); |
307 |
|
} |
308 |
|
|
309 |
|
/** |
333 |
|
* If exceptional, r is first coerced to a CompletionException. |
334 |
|
*/ |
335 |
|
final boolean completeRelay(Object r) { |
336 |
< |
return RESULT.compareAndSet(this, (Object)null, encodeRelay(r)); |
336 |
> |
return RESULT.compareAndSet(this, null, encodeRelay(r)); |
337 |
|
} |
338 |
|
|
339 |
|
/** |