]> Cypherpunks repositories - gostls13.git/commit
runtime: help the race detector detect possible concurrent cleanups
authorMichael Anthony Knyszek <mknyszek@google.com>
Tue, 25 Feb 2025 22:50:10 +0000 (22:50 +0000)
committerGopher Robot <gobot@golang.org>
Thu, 15 May 2025 02:12:19 +0000 (19:12 -0700)
commit3ea94ae446727ab75f6baa38444cf49041cb3b16
tree78f4f5f812c01ddf21cc946b3f8a507369e28d1e
parentb30fa1bcc411f3a65a6e8f40ff3acdb1526ce0d0
runtime: help the race detector detect possible concurrent cleanups

This change makes it so that cleanup goroutines, in race mode, create a
fake race context and switch to it, emulating cleanups running on new
goroutines. This helps in catching races between cleanups that might run
concurrently.

Change-Id: I4c4e33054313798d4ac4e5d91ff2487ea3eb4b16
Reviewed-on: https://go-review.googlesource.com/c/go/+/652635
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Michael Knyszek <mknyszek@google.com>
Reviewed-by: David Chase <drchase@google.com>
Reviewed-by: Michael Pratt <mpratt@google.com>
src/runtime/mcleanup.go
src/runtime/race.go
src/runtime/race/testdata/finalizer_test.go
src/runtime/race0.go