List of usage examples for java.util.concurrent.atomic AtomicIntegerArray compareAndSet
public final boolean compareAndSet(int i, int expectedValue, int newValue)
From source file:Main.java
public static void main(String[] argv) throws Exception { AtomicIntegerArray atomicIntegerArray = new AtomicIntegerArray(new int[] { 0, 1, 2, 3 }); atomicIntegerArray.compareAndSet(0, 10, 20); System.out.println(atomicIntegerArray.addAndGet(2, 10)); }