// Atomic($T) load/store (seq_cst), single-thread. // Stream A (atomics) A.0 — the first net-new atomic codegen example. // Explicit orderings (a.load(.acquire)) arrive in A.0.5; see PLAN-ATOMICS.md. // Atomics is an opt-in import (not in the universal prelude) — like `trace`. #import "modules/std.sx"; #import "modules/std/atomic.sx"; main :: () { a := Atomic(i64).init(7); print("init: {}\n", a.load()); a.store(42); print("after store: {}\n", a.load()); a.store(a.load() + 1); print("incremented: {}\n", a.load()); }