public final boolean getAndSet (boolean newValue)

Atomically sets the value to newValue and returns the old value, with memory effects as specified by VarHandle.getAndSet.

Parameters:
newValue    the new value

Returns:  the previous value