equal
deleted
inserted
replaced
215 public final E getAndUpdate(int i, UnaryOperator<E> updateFunction) { |
215 public final E getAndUpdate(int i, UnaryOperator<E> updateFunction) { |
216 long offset = checkedByteOffset(i); |
216 long offset = checkedByteOffset(i); |
217 E prev, next; |
217 E prev, next; |
218 do { |
218 do { |
219 prev = getRaw(offset); |
219 prev = getRaw(offset); |
220 next = updateFunction.operate(prev); |
220 next = updateFunction.apply(prev); |
221 } while (!compareAndSetRaw(offset, prev, next)); |
221 } while (!compareAndSetRaw(offset, prev, next)); |
222 return prev; |
222 return prev; |
223 } |
223 } |
224 |
224 |
225 /** |
225 /** |
236 public final E updateAndGet(int i, UnaryOperator<E> updateFunction) { |
236 public final E updateAndGet(int i, UnaryOperator<E> updateFunction) { |
237 long offset = checkedByteOffset(i); |
237 long offset = checkedByteOffset(i); |
238 E prev, next; |
238 E prev, next; |
239 do { |
239 do { |
240 prev = getRaw(offset); |
240 prev = getRaw(offset); |
241 next = updateFunction.operate(prev); |
241 next = updateFunction.apply(prev); |
242 } while (!compareAndSetRaw(offset, prev, next)); |
242 } while (!compareAndSetRaw(offset, prev, next)); |
243 return next; |
243 return next; |
244 } |
244 } |
245 |
245 |
246 /** |
246 /** |
262 BinaryOperator<E> accumulatorFunction) { |
262 BinaryOperator<E> accumulatorFunction) { |
263 long offset = checkedByteOffset(i); |
263 long offset = checkedByteOffset(i); |
264 E prev, next; |
264 E prev, next; |
265 do { |
265 do { |
266 prev = getRaw(offset); |
266 prev = getRaw(offset); |
267 next = accumulatorFunction.operate(prev, x); |
267 next = accumulatorFunction.apply(prev, x); |
268 } while (!compareAndSetRaw(offset, prev, next)); |
268 } while (!compareAndSetRaw(offset, prev, next)); |
269 return prev; |
269 return prev; |
270 } |
270 } |
271 |
271 |
272 /** |
272 /** |
288 BinaryOperator<E> accumulatorFunction) { |
288 BinaryOperator<E> accumulatorFunction) { |
289 long offset = checkedByteOffset(i); |
289 long offset = checkedByteOffset(i); |
290 E prev, next; |
290 E prev, next; |
291 do { |
291 do { |
292 prev = getRaw(offset); |
292 prev = getRaw(offset); |
293 next = accumulatorFunction.operate(prev, x); |
293 next = accumulatorFunction.apply(prev, x); |
294 } while (!compareAndSetRaw(offset, prev, next)); |
294 } while (!compareAndSetRaw(offset, prev, next)); |
295 return next; |
295 return next; |
296 } |
296 } |
297 |
297 |
298 /** |
298 /** |