A boolean value that may be updated atomically. See the java.util.concurrent.atomic package specification for description of the properties of atomic variables. An AtomicBoolean is used in applications such as atomically updated flags, and cannot be used as a replacement for a Boolean.
A boolean value that may be updated atomically. See the java.util.concurrent.atomic package specification for description of the properties of atomic variables. An AtomicBoolean is used in applications such as atomically updated flags, and cannot be used as a replacement for a Boolean.
(->atomic-boolean)
(->atomic-boolean initial-value)
Constructor.
Creates a new AtomicBoolean with the given initial value.
initial-value - the initial value - boolean
Constructor. Creates a new AtomicBoolean with the given initial value. initial-value - the initial value - `boolean`
(compare-and-set this expect update)
Atomically sets the value to the given updated value if the current value == the expected value.
expect - the expected value - boolean
update - the new value - boolean
returns: true if successful. False return indicates that
the actual value was not equal to the expected value. - boolean
Atomically sets the value to the given updated value if the current value == the expected value. expect - the expected value - `boolean` update - the new value - `boolean` returns: true if successful. False return indicates that the actual value was not equal to the expected value. - `boolean`
(get this)
Returns the current value.
returns: the current value - boolean
Returns the current value. returns: the current value - `boolean`
(get-and-set? this new-value)
Atomically sets to the given value and returns the previous value.
new-value - the new value - boolean
returns: the previous value - boolean
Atomically sets to the given value and returns the previous value. new-value - the new value - `boolean` returns: the previous value - `boolean`
(lazy-set this new-value)
Eventually sets to the given value.
new-value - the new value - boolean
Eventually sets to the given value. new-value - the new value - `boolean`
(set this new-value)
Unconditionally sets to the given value.
new-value - the new value - boolean
Unconditionally sets to the given value. new-value - the new value - `boolean`
(to-string this)
Returns the String representation of the current value.
returns: the String representation of the current value - java.lang.String
Returns the String representation of the current value. returns: the String representation of the current value - `java.lang.String`
(weak-compare-and-set this expect update)
Atomically sets the value to the given updated value if the current value == the expected value.
May fail spuriously and does not provide ordering guarantees, so is only rarely an appropriate alternative to compareAndSet.
expect - the expected value - boolean
update - the new value - boolean
returns: true if successful - boolean
Atomically sets the value to the given updated value if the current value == the expected value. May fail spuriously and does not provide ordering guarantees, so is only rarely an appropriate alternative to compareAndSet. expect - the expected value - `boolean` update - the new value - `boolean` returns: true if successful - `boolean`
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close