Updated CodeReviewConcurrency (markdown)

Peter Bourgon 2021-05-10 11:30:56 +02:00
parent c1e98874f6
commit b77df48e74

@ -122,6 +122,8 @@ Such a race condition could be benign in some cases: for example, the logic betw
`Store()` calls computes the value to be cached in the map, and this computation always returns the
same result and doesn't have side effects.
> ⚠️ **False information**. There is no such thing as a benign race condition.
If the race condition is not benign, use methods [`sync.Map.LoadOrStore()`](
https://golang.org/pkg/sync/#Map.LoadOrStore) and [`LoadAndDelete()`](
https://golang.org/pkg/sync/#Map.LoadAndDelete) to fix it.