Example usage for Java java.util.concurrent.atomic AtomicBoolean fields, constructors, methods, implement or subclass
The text is from its open source code.
AtomicBoolean() Creates a new AtomicBoolean with initial value false . | |
AtomicBoolean(boolean initialValue) Creates a new AtomicBoolean with the given initial value. |
boolean | compareAndSet(boolean expectedValue, boolean newValue) Atomically sets the value to newValue if the current value == expectedValue , with memory effects as specified by VarHandle#compareAndSet . |
boolean | get() Returns the current value, with memory effects as specified by VarHandle#getVolatile . |
boolean | getAndSet(boolean newValue) Atomically sets the value to newValue and returns the old value, with memory effects as specified by VarHandle#getAndSet . |
void | lazySet(boolean newValue) Sets the value to newValue , with memory effects as specified by VarHandle#setRelease . |
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(boolean newValue) Sets the value to newValue , with memory effects as specified by VarHandle#setVolatile . |
String | toString() Returns the String representation of the current 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. |
boolean | weakCompareAndSet(boolean expectedValue, boolean newValue) Possibly atomically sets the value to newValue if the current value == expectedValue , with memory effects as specified by VarHandle#weakCompareAndSetPlain . |