This website uses strictly necessary cookies & statistics cookies to provide functionality and to analyze traffic.
The sync.Once is probably the easiest sync primitive to use, but there’s more under the hood than you might think. It’s also a good opportunity to understand how it works by juggling both atomic operations and mutexes.