An object reference that may be updated atomically. See the java.util.concurrent.atomic package specification for description of the properties of atomic variables.
An object reference that may be updated atomically. See the java.util.concurrent.atomic package specification for description of the properties of atomic variables.
(->atomic-reference)
(->atomic-reference initial-value)
Constructor.
Creates a new AtomicReference with the given initial value.
initial-value - the initial value - V
Constructor. Creates a new AtomicReference with the given initial value. initial-value - the initial value - `V`
(accumulate-and-get this x accumulator-function)
Atomically updates the current value with the results of applying the given function to the current and given values, returning the updated value. The function should be side-effect-free, since it may be re-applied when attempted updates fail due to contention among threads. The function is applied with the current value as its first argument, and the given update as the second argument.
x - the update value - V
accumulator-function - a side-effect-free function of two arguments - java.util.function.BinaryOperator
returns: the updated value - V
Atomically updates the current value with the results of applying the given function to the current and given values, returning the updated value. The function should be side-effect-free, since it may be re-applied when attempted updates fail due to contention among threads. The function is applied with the current value as its first argument, and the given update as the second argument. x - the update value - `V` accumulator-function - a side-effect-free function of two arguments - `java.util.function.BinaryOperator` returns: the updated value - `V`
(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 - V
update - the new value - V
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 - `V` update - the new value - `V` returns: true if successful. False return indicates that the actual value was not equal to the expected value. - `boolean`
(get this)
Gets the current value.
returns: the current value - V
Gets the current value. returns: the current value - `V`
(get-and-accumulate this x accumulator-function)
Atomically updates the current value with the results of applying the given function to the current and given values, returning the previous value. The function should be side-effect-free, since it may be re-applied when attempted updates fail due to contention among threads. The function is applied with the current value as its first argument, and the given update as the second argument.
x - the update value - V
accumulator-function - a side-effect-free function of two arguments - java.util.function.BinaryOperator
returns: the previous value - V
Atomically updates the current value with the results of applying the given function to the current and given values, returning the previous value. The function should be side-effect-free, since it may be re-applied when attempted updates fail due to contention among threads. The function is applied with the current value as its first argument, and the given update as the second argument. x - the update value - `V` accumulator-function - a side-effect-free function of two arguments - `java.util.function.BinaryOperator` returns: the previous value - `V`
(get-and-set this new-value)
Atomically sets to the given value and returns the old value.
new-value - the new value - V
returns: the previous value - V
Atomically sets to the given value and returns the old value. new-value - the new value - `V` returns: the previous value - `V`
(get-and-update this update-function)
Atomically updates the current value with the results of applying the given function, returning the previous value. The function should be side-effect-free, since it may be re-applied when attempted updates fail due to contention among threads.
update-function - a side-effect-free function - java.util.function.UnaryOperator
returns: the previous value - V
Atomically updates the current value with the results of applying the given function, returning the previous value. The function should be side-effect-free, since it may be re-applied when attempted updates fail due to contention among threads. update-function - a side-effect-free function - `java.util.function.UnaryOperator` returns: the previous value - `V`
(lazy-set this new-value)
Eventually sets to the given value.
new-value - the new value - V
Eventually sets to the given value. new-value - the new value - `V`
(set this new-value)
Sets to the given value.
new-value - the new value - V
Sets to the given value. new-value - the new value - `V`
(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`
(update-and-get this update-function)
Atomically updates the current value with the results of applying the given function, returning the updated value. The function should be side-effect-free, since it may be re-applied when attempted updates fail due to contention among threads.
update-function - a side-effect-free function - java.util.function.UnaryOperator
returns: the updated value - V
Atomically updates the current value with the results of applying the given function, returning the updated value. The function should be side-effect-free, since it may be re-applied when attempted updates fail due to contention among threads. update-function - a side-effect-free function - `java.util.function.UnaryOperator` returns: the updated value - `V`
(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 - V
update - the new value - V
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 - `V` update - the new value - `V` returns: true if successful - `boolean`
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close