Atomic references wrapping Boolean
values.
Note that the equality test in compareAndSet
is value based,
since Boolean
is a primitive.
- Companion:
- object
Value members
Concrete methods
Inherited methods
Get the current value persisted by this Atomic, an alias for get()
.
Get the current value persisted by this Atomic, an alias for get()
.
- Inherited from:
- Atomic
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.
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.
- Value parameters:
- cb
is a callback that receives the current value as input and returns the
update
which is the new value that should be persisted
- Returns:
the old value, just prior to when the successful update happened
- Inherited from:
- Atomic
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.
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.
- Value parameters:
- cb
is a callback that receives the current value as input and returns the
update
which is the new value that should be persisted
- Inherited from:
- Atomic
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.
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.
- Value parameters:
- cb
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.
- Returns:
whatever was specified by your callback, once the operation succeeds
- Inherited from:
- Atomic
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.
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.
- Value parameters:
- cb
is a callback that receives the current value as input and returns the
update
which is the new value that should be persisted
- Returns:
whatever the update is, after the operation succeeds
- Inherited from:
- Atomic