]> Cypherpunks.ru repositories - gostls13.git/commit
runtime: add race annotations in IncNonDefault
authorDavid Chase <drchase@google.com>
Thu, 14 Dec 2023 19:20:12 +0000 (14:20 -0500)
committerDavid Chase <drchase@google.com>
Fri, 15 Dec 2023 20:30:44 +0000 (20:30 +0000)
commit3313bbb4055f38f53cd43c6c5782a229f445f230
treedc21ea7c327d01b9c34a1509c1ca06f26bcd4c43
parentb60bf8f8e131b026eb2691e736d3df9dce852297
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).

Fixes #64649

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>
src/internal/godebug/godebug_test.go
src/runtime/runtime.go