]> Cypherpunks repositories - gostls13.git/commitdiff
doc/go1.20: document new sync.Map methods
authorBryan C. Mills <bcmills@google.com>
Tue, 15 Nov 2022 22:07:00 +0000 (17:07 -0500)
committerGopher Robot <gobot@golang.org>
Tue, 15 Nov 2022 23:48:34 +0000 (23:48 +0000)
For #51972.

Change-Id: I86dcd8abc3b62e20b524541327af2cc891cb251d
Reviewed-on: https://go-review.googlesource.com/c/go/+/450797
Reviewed-by: Ian Lance Taylor <iant@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Auto-Submit: Bryan Mills <bcmills@google.com>
Run-TryBot: Bryan Mills <bcmills@google.com>

doc/go1.20.html

index 509cab92533ae38d1429e73a6f802f1e4f5a84f0..3d4eeb0f364194cc942599823b0b1eee2b00127f 100644 (file)
@@ -740,6 +740,17 @@ proxyHandler := &httputil.ReverseProxy{
   </dd>
 </dl><!-- strings -->
 
+<dl id="sync"><dt><a href="/pkg/sync/">sync</a></dt>
+  <dd>
+    <p><!-- CL 399094, https://go.dev/issue/51972 -->
+      The new methods <a href="/pkg/sync/#Map.Swap"><code>Map.Swap</code></a>,
+      <a href="/pkg/sync/#Map.CompareAndSwap"><code>Map.CompareAndSwap</code></a>, and
+      <a href="/pkg/sync/#Map.CompareAndDelete"><code>Map.CompareAndDelete</code></a>
+      allow existing map entries to be updated atomically.
+    </p>
+  </dd>
+</dl><!-- sync -->
+
 <dl id="syscall"><dt><a href="/pkg/syscall/">syscall</a></dt>
   <dd>
     <p><!-- CL 407574 -->