ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/jsr166/jsr166/src/main/java/util/concurrent/CompletableFuture.java
(Generate patch)

Comparing jsr166/src/main/java/util/concurrent/CompletableFuture.java (file contents):
Revision 1.193 by jsr166, Thu Jun 2 13:40:42 2016 UTC vs.
Revision 1.194 by jsr166, Thu Jun 2 14:47:42 2016 UTC

# Line 225 | Line 225 | public class CompletableFuture<T> implem
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. */
# Line 252 | Line 252 | public class CompletableFuture<T> implem
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. */
# Line 262 | Line 262 | public class CompletableFuture<T> implem
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      /**
# Line 276 | Line 276 | public class CompletableFuture<T> implem
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      /**
# Line 303 | Line 303 | public class CompletableFuture<T> implem
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      /**
# Line 333 | Line 333 | public class CompletableFuture<T> implem
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      /**

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines