mirror of
https://github.com/containerd/containerd.git
synced 2026-08-09 09:33:06 +00:00
We've long been able to use these and they have a couple great benefits: 1. Forces you to always access them atomically. With the pointer variants it's completely valid to access the regular ol' int64/uint32 etc. without using the atomic.* methods. These wrappers don't provide access to the underlying value so it forces correct usage always. 2. Conveys intent much better. Seeing the type be atomic.Int32 immediately lets the reader know that this var will be used in a concurrent context, and we no longer need comments like "this MUST be accessed atomically" or similar. Signed-off-by: Danny Canter <danny@dcantah.dev>