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