From b77df48e740cca89383e83d3ccbc6392826ff34b Mon Sep 17 00:00:00 2001 From: Peter Bourgon Date: Mon, 10 May 2021 11:30:56 +0200 Subject: [PATCH] Updated CodeReviewConcurrency (markdown) --- CodeReviewConcurrency.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CodeReviewConcurrency.md b/CodeReviewConcurrency.md index c3e1c74d..6863129c 100644 --- a/CodeReviewConcurrency.md +++ b/CodeReviewConcurrency.md @@ -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.