Fuzion Logo
fuzion-lang.dev — The Fuzion Language Portal
JavaScript seems to be disabled. Functionality is limited.

update

mutate.var.update

(F 
type
: Unary T T, f F)
 => 
tuple T T
update mutable field using a function of the old value

Different kinds of mutate will make different efforts for synchronization:

- for a thread-local `mutate`, this can be used only by the thread that instated
the `mutate`, no synchronization will be performed.

- for a `concur.blocking_mutate`/`concur.blocking_mutate_using_clock`, this will
use `exclusive` to ensure atomicity

- for a `atomic_mutate`, this will use a loop that performs `compare_and_swap`
repeatedly until the update was successful.
Precondition
pre
  safety: open
  safety: !is_atomic || atomic_access_supported T

Type Parameters

function type, permits specialization of calls for each function
0.099dev (GIT hash 1bef408f37c37f3ff3417cdf772c6c40c76064ca)
last changed: 2026-09-17