Alias for set.
Get the current value persisted by this Atomic, an alias for get()
.
Get the current value persisted by this Atomic, an alias for get()
.
Does a compare-and-set operation on the current value.
Does a compare-and-set operation on the current value. For more info, checkout the related Compare-and-swap Wikipedia page.
It's an atomic, worry free operation.
is the value you expect to be persisted when the operation happens
will be the new value, should the check for expect
succeeds
either true in case the operation succeeded or false otherwise
Get the current value persisted by this Atomic.
Sets the persisted value to update
and returns the old value that was in place.
Abstracts over compareAndSet
.
Abstracts over compareAndSet
. You specify a transformation by specifying a callback to be
executed, a callback that transforms the current value. This method will loop until it will
succeed in replacing the current value with the one produced by the given callback.
Note that the callback will be executed on each iteration of the loop, so it can be called multiple times - don't do destructive I/O or operations that mutate global state in it.
is a callback that receives the current value as input and returns the update
which is the
new value that should be persisted
the old value, just prior to when the successful update happened
Eventually sets to the given value.
Updates the current value.
Abstracts over compareAndSet
.
Abstracts over compareAndSet
. You specify a transformation by specifying a callback to be
executed, a callback that transforms the current value. This method will loop until it will
succeed in replacing the current value with the one produced by the given callback.
Note that the callback will be executed on each iteration of the loop, so it can be called multiple times - don't do destructive I/O or operations that mutate global state in it.
is a callback that receives the current value as input and returns the update
which is the
new value that should be persisted
Abstracts over compareAndSet
.
Abstracts over compareAndSet
. You specify a transformation by specifying a callback to be
executed, a callback that transforms the current value. This method will loop until it will
succeed in replacing the current value with the one produced by your callback.
Note that the callback will be executed on each iteration of the loop, so it can be called multiple times - don't do destructive I/O or operations that mutate global state in it.
is a callback that receives the current value as input and returns a tuple that specifies the update + what should this method return when the operation succeeds.
whatever was specified by your callback, once the operation succeeds
Abstracts over compareAndSet
.
Abstracts over compareAndSet
. You specify a transformation by specifying a callback to be
executed, a callback that transforms the current value. This method will loop until it will
succeed in replacing the current value with the one produced by the given callback.
Note that the callback will be executed on each iteration of the loop, so it can be called multiple times - don't do destructive I/O or operations that mutate global state in it.
is a callback that receives the current value as input and returns the update
which is the
new value that should be persisted
whatever the update is, after the operation succeeds
Alias for set.
Atomic references wrapping
AnyRef
values.is forced to be an
AnyRef
because the equality test is by reference and not by value.