Skip to content

Commit 7ce45a0

Browse files
rhyshgopherbot
authored andcommitted
runtime: fix test of when a mutex is contended
This is used only in tests that verify reports of runtime-internal mutex contention. For #66999 For #70602 Change-Id: I72cb1302d8ea0524f1182ec892f5c9a1923cddba Reviewed-on: https://go-review.googlesource.com/c/go/+/667095 Reviewed-by: Michael Knyszek <[email protected]> LUCI-TryBot-Result: Go LUCI <[email protected]> Auto-Submit: Rhys Hiltner <[email protected]> Reviewed-by: Junyang Shao <[email protected]>
1 parent 95611c0 commit 7ce45a0

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/runtime/lock_spinbit.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ func mutexPreferLowLatency(l *mutex) bool {
143143
}
144144

145145
func mutexContended(l *mutex) bool {
146-
return atomic.Loaduintptr(&l.key) > mutexLocked
146+
return atomic.Loaduintptr(&l.key)&^mutexMMask != 0
147147
}
148148

149149
func lock(l *mutex) {

0 commit comments

Comments
 (0)