For shared counters and flags, `AtomicU64` / `AtomicBool` etc. are much faster than `Mutex`. Operations like `fetch_add` are single CPU instructions on most architectures.
For simple counters and flags, atomic ops are much faster than `sync.Mutex`. Go 1.19+ added typed wrappers (`atomic.Int64`) — clearer than the raw functions.