0b56804084
CL 549796 adds race annotations to godebugInc. It uses racerelease to model a CompareAndSwap. However, a CompareAndSwap is essentially a load and a store. Modeling it as just racerelease makes it not synchronized with other racerelease, i.e. other CAS. For the following execution thread A B load, got nil load, got nil set *inc set *inc racerelease CAS success racerelease CAS fail load raceacquire use *inc (from A) On thread B, the raceacquire synchronizes with the previous racerelease, which is not synchronized with racerelease on thread A, so it doesn't know that the use of *inc on thread B is after the set on thread A, and will report a race. Change it to use racereleasemerge, which synchronizes with previous racerelease and racereleasemerge. So in the case above it knows thread B's CAS is after thread A's. Also remove stale comment that was more relevant when the code used atomic store, where CL 549796 changed to CAS. Updates #64649. Change-Id: I17671090a19c0699fcb4e6481e2abd98ef2e5542 Reviewed-on: https://go-review.googlesource.com/c/go/+/551856 Reviewed-by: Mauri de Souza Meneguzzo <mauri870@gmail.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: David Chase <drchase@google.com> |
||
---|---|---|
.github | ||
api | ||
doc | ||
lib/time | ||
misc | ||
src | ||
test | ||
.gitattributes | ||
.gitignore | ||
codereview.cfg | ||
CONTRIBUTING.md | ||
go.env | ||
LICENSE | ||
PATENTS | ||
README.md | ||
SECURITY.md |
The Go Programming Language
Go is an open source programming language that makes it easy to build simple, reliable, and efficient software.
Gopher image by Renee French, licensed under Creative Commons 4.0 Attributions license.
Our canonical Git repository is located at https://go.googlesource.com/go. There is a mirror of the repository at https://github.com/golang/go.
Unless otherwise noted, the Go source files are distributed under the BSD-style license found in the LICENSE file.
Download and Install
Binary Distributions
Official binary distributions are available at https://go.dev/dl/.
After downloading a binary release, visit https://go.dev/doc/install for installation instructions.
Install From Source
If a binary distribution is not available for your combination of operating system and architecture, visit https://go.dev/doc/install/source for source installation instructions.
Contributing
Go is the work of thousands of contributors. We appreciate your help!
To contribute, please read the contribution guidelines at https://go.dev/doc/contribute.
Note that the Go project uses the issue tracker for bug reports and proposals only. See https://go.dev/wiki/Questions for a list of places to ask questions about the Go language.