/** * Atomically sets to the given value and returns the previous value. * * @param newValue the new value * @return the previous value */ public final java.lang.String getAndSet(java.lang.String newValue) { //$DELAY$ for (;;) { //$DELAY$ java.lang.String current = get(); //$DELAY$ if (compareAndSet(current, newValue)) { //$DELAY$ return current; } } }