Skip to content

Commit 5e98202

Browse files
rhyshgopherbot
authored andcommitted
internal/buildcfg: expand spinbitmutex platforms
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 <[email protected]> LUCI-TryBot-Result: Go LUCI <[email protected]> Auto-Submit: Rhys Hiltner <[email protected]> Reviewed-by: Michael Knyszek <[email protected]>
1 parent e41ec30 commit 5e98202

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

src/internal/buildcfg/exp.go

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -67,11 +67,7 @@ func ParseGOEXPERIMENT(goos, goarch, goexp string) (*ExperimentFlags, error) {
6767
regabiSupported = true
6868
}
6969

70-
var haveXchg8 bool
71-
switch goarch {
72-
case "386", "amd64", "arm", "arm64", "ppc64le", "ppc64":
73-
haveXchg8 = true
74-
}
70+
haveThreads := goarch != "wasm"
7571

7672
// Older versions (anything before V16) of dsymutil don't handle
7773
// the .debug_rnglists section in DWARF5. See
@@ -89,7 +85,7 @@ func ParseGOEXPERIMENT(goos, goarch, goexp string) (*ExperimentFlags, error) {
8985
RegabiArgs: regabiSupported,
9086
AliasTypeParams: true,
9187
SwissMap: true,
92-
SpinbitMutex: haveXchg8,
88+
SpinbitMutex: haveThreads,
9389
SyncHashTrieMap: true,
9490
Dwarf5: dwarf5Supported,
9591
}

0 commit comments

Comments
 (0)