jdk/src/share/classes/java/util/concurrent/atomic/AtomicLongArray.java
changeset 16011 890a7ed97f6c
parent 15267 c884f548a25f
child 18576 7a5c231327af
equal deleted inserted replaced
16010:2727163b5df5 16011:890a7ed97f6c
   260     public final long getAndUpdate(int i, LongUnaryOperator updateFunction) {
   260     public final long getAndUpdate(int i, LongUnaryOperator updateFunction) {
   261         long offset = checkedByteOffset(i);
   261         long offset = checkedByteOffset(i);
   262         long prev, next;
   262         long prev, next;
   263         do {
   263         do {
   264             prev = getRaw(offset);
   264             prev = getRaw(offset);
   265             next = updateFunction.operateAsLong(prev);
   265             next = updateFunction.applyAsLong(prev);
   266         } while (!compareAndSetRaw(offset, prev, next));
   266         } while (!compareAndSetRaw(offset, prev, next));
   267         return prev;
   267         return prev;
   268     }
   268     }
   269 
   269 
   270     /**
   270     /**
   281     public final long updateAndGet(int i, LongUnaryOperator updateFunction) {
   281     public final long updateAndGet(int i, LongUnaryOperator updateFunction) {
   282         long offset = checkedByteOffset(i);
   282         long offset = checkedByteOffset(i);
   283         long prev, next;
   283         long prev, next;
   284         do {
   284         do {
   285             prev = getRaw(offset);
   285             prev = getRaw(offset);
   286             next = updateFunction.operateAsLong(prev);
   286             next = updateFunction.applyAsLong(prev);
   287         } while (!compareAndSetRaw(offset, prev, next));
   287         } while (!compareAndSetRaw(offset, prev, next));
   288         return next;
   288         return next;
   289     }
   289     }
   290 
   290 
   291     /**
   291     /**
   307                                       LongBinaryOperator accumulatorFunction) {
   307                                       LongBinaryOperator accumulatorFunction) {
   308         long offset = checkedByteOffset(i);
   308         long offset = checkedByteOffset(i);
   309         long prev, next;
   309         long prev, next;
   310         do {
   310         do {
   311             prev = getRaw(offset);
   311             prev = getRaw(offset);
   312             next = accumulatorFunction.operateAsLong(prev, x);
   312             next = accumulatorFunction.applyAsLong(prev, x);
   313         } while (!compareAndSetRaw(offset, prev, next));
   313         } while (!compareAndSetRaw(offset, prev, next));
   314         return prev;
   314         return prev;
   315     }
   315     }
   316 
   316 
   317     /**
   317     /**
   333                                       LongBinaryOperator accumulatorFunction) {
   333                                       LongBinaryOperator accumulatorFunction) {
   334         long offset = checkedByteOffset(i);
   334         long offset = checkedByteOffset(i);
   335         long prev, next;
   335         long prev, next;
   336         do {
   336         do {
   337             prev = getRaw(offset);
   337             prev = getRaw(offset);
   338             next = accumulatorFunction.operateAsLong(prev, x);
   338             next = accumulatorFunction.applyAsLong(prev, x);
   339         } while (!compareAndSetRaw(offset, prev, next));
   339         } while (!compareAndSetRaw(offset, prev, next));
   340         return next;
   340         return next;
   341     }
   341     }
   342 
   342 
   343     /**
   343     /**