Add a memory barrier on the failure case of the
compare-and-swap for mips, this avoids potential
race conditions.
For #63506
Change-Id: I3df1479d1438ba72aa72567eb3dea76ff745e98d
GitHub-Last-Rev:
2101b9fd446f28f856986b27d20f92cd4a1f4fef
GitHub-Pull-Request: golang/go#63604
Reviewed-on: https://go-review.googlesource.com/c/go/+/536116
Auto-Submit: Keith Randall <khr@golang.org>
Reviewed-by: Keith Randall <khr@golang.org>
Reviewed-by: David Chase <drchase@google.com>
Reviewed-by: Keith Randall <khr@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
spinUnlock(&lock.state)
}
-//go:nosplit
-func unlockNoFence() {
- lock.state = 0
-}
-
//go:nosplit
func Xadd64(addr *uint64, delta int64) (new uint64) {
lockAndCheck(addr)
return true
}
- unlockNoFence()
+ unlock()
return false
}
MOVB R3, ret+12(FP)
RET
cas_fail:
+ SYNC
MOVB R0, ret+12(FP)
RET