]> Cypherpunks repositories - gostls13.git/commitdiff
internal/buildcfg: expand spinbitmutex platforms
authorRhys Hiltner <rhys.hiltner@gmail.com>
Fri, 14 Mar 2025 19:04:51 +0000 (12:04 -0700)
committerGopher Robot <gobot@golang.org>
Mon, 17 Mar 2025 20:10:18 +0000 (13:10 -0700)
Go 1.24 included the spinbitmutex GOEXPERIMENT for several popular
architectures, based on their native support an atomic primitive (8-bit
exchange) that aided its efficient implementation.

Move towards making the new mutex implementation permanent, so it fully
replaces the two previous (sema- and futex-based "tristate")
implementations.

For #68578

Change-Id: I888a73959df42eb0ec53875309c446675af8f09d
Reviewed-on: https://go-review.googlesource.com/c/go/+/658455
Reviewed-by: David Chase <drchase@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Rhys Hiltner <rhys.hiltner@gmail.com>
Reviewed-by: Michael Knyszek <mknyszek@google.com>
src/internal/buildcfg/exp.go

index 8fb4beb7c9f4167a886a277e15eeb9cbe6ae8307..ccdf465ffbba872f3f140f8479365c4ca3becf67 100644 (file)
@@ -67,11 +67,7 @@ func ParseGOEXPERIMENT(goos, goarch, goexp string) (*ExperimentFlags, error) {
                regabiSupported = true
        }
 
-       var haveXchg8 bool
-       switch goarch {
-       case "386", "amd64", "arm", "arm64", "ppc64le", "ppc64":
-               haveXchg8 = true
-       }
+       haveThreads := goarch != "wasm"
 
        // Older versions (anything before V16) of dsymutil don't handle
        // the .debug_rnglists section in DWARF5. See
@@ -89,7 +85,7 @@ func ParseGOEXPERIMENT(goos, goarch, goexp string) (*ExperimentFlags, error) {
                RegabiArgs:      regabiSupported,
                AliasTypeParams: true,
                SwissMap:        true,
-               SpinbitMutex:    haveXchg8,
+               SpinbitMutex:    haveThreads,
                SyncHashTrieMap: true,
                Dwarf5:          dwarf5Supported,
        }