Example usage for Java java.util.concurrent.atomic AtomicReference fields, constructors, methods, implement or subclass
The text is from its open source code.
AtomicReference() Creates a new AtomicReference with null initial value. | |
AtomicReference(V initialValue) Creates a new AtomicReference with the given initial value. |
boolean | compareAndSet(V expectedValue, V newValue) Atomically sets the value to newValue if the current value == expectedValue , with memory effects as specified by VarHandle#compareAndSet . |
V | get() Returns the current value, with memory effects as specified by VarHandle#getVolatile . |
V | getAndSet(V newValue) Atomically sets the value to newValue and returns the old value, with memory effects as specified by VarHandle#getAndSet . |
void | notify() Wakes up a single thread that is waiting on this object's monitor. |
void | notifyAll() Wakes up all threads that are waiting on this object's monitor. |
void | set(V newValue) Sets the value to newValue , with memory effects as specified by VarHandle#setVolatile . |
String | toString() Returns the String representation of the current value. |
V | updateAndGet(UnaryOperator Atomically updates (with memory effects as specified by VarHandle#compareAndSet ) the current value with the results of applying the given function, returning the updated value. |
void | wait(long timeoutMillis) Causes the current thread to wait until it is awakened, typically by being notified or interrupted, or until a certain amount of real time has elapsed. |
void | wait() Causes the current thread to wait until it is awakened, typically by being notified or interrupted. |