Adds to the atomic number the given value.
Adds to the atomic number and returns the result.
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
Decrements the atomic number with the given integer.
Decrements the atomic number and returns the result.
Get the current value persisted by this Atomic.
Get the current value persisted by this Atomic.
Adds to the the atomic number and returns the value before the update.
Decrements the atomic number and returns the value before the update.
Increments the atomic number and returns the value before the update.
Sets the persisted value to update
and returns the old value that was in place.
Sets the persisted value to update
and returns the old value that was in place.
It's an atomic, worry free operation.
Subtracts from the atomic number and returns the value before the update.
Increment with the given integer
Increments the atomic number and returns the result.
Eventually sets to the given value.
Eventually sets to the given value.
Has weaker visibility guarantees than the normal set()
.
Updates the current value.
Subtracts from the atomic number the given value.
Subtracts from the atomic number and returns the result.
Subtracts from the atomic number the given value.
Subtracts from the atomic number the given value. Alias for subtract
.
Adds to the atomic number the given value.
Adds to the atomic number the given value. Alias for add
.
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()
.
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
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.
Represents an Atomic reference holding a number, providing helpers for easily incrementing and decrementing it.
should be something that's Numeric