]> Cypherpunks.ru repositories - gostls13.git/commit
[release-branch.go1.21] runtime: add race annotations in IncNonDefault
authorDavid Chase <drchase@google.com>
Thu, 14 Dec 2023 19:20:12 +0000 (14:20 -0500)
committerGopher Robot <gobot@golang.org>
Thu, 4 Jan 2024 21:37:29 +0000 (21:37 +0000)
commit8c6078adfbfc2ba5a2108dfddfafc3b69cce410e
tree89f6dd0ab66d61155cafb8717aa68e8bf0258f9a
parentf6b203c8281cc84b9846a550aeee40ac395274ae
[release-branch.go1.21] runtime: add race annotations in IncNonDefault

Also use CompareAndSwap to make the code actually less racy.

Added a test which will be meaningful when run under the race
detector (tested it -race with broken fix in runtime, it failed).

This backport incorporates the correction in CL 551856,
using racereleasemerge instead of racerelease.

Fixes #64757

Change-Id: I5972e08901d1adc8ba74858edad7eba91be1b0ce
Reviewed-on: https://go-review.googlesource.com/c/go/+/549796
Run-TryBot: David Chase <drchase@google.com>
Reviewed-by: Mauri de Souza Meneguzzo <mauri870@gmail.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
(cherry picked from commit 3313bbb4055f38f53cd43c6c5782a229f445f230)
Reviewed-on: https://go-review.googlesource.com/c/go/+/550236
Auto-Submit: Matthew Dempsky <mdempsky@google.com>
TryBot-Bypass: Matthew Dempsky <mdempsky@google.com>
Reviewed-by: Michael Knyszek <mknyszek@google.com>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
src/internal/godebug/godebug_test.go
src/runtime/runtime.go