mirror of
https://github.com/golang/go.git
synced 2025-05-05 15:43:04 +00:00
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 <mknyszek@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: Junyang Shao <shaojunyang@google.com>
This commit is contained in:
parent
95611c0eb4
commit
7ce45a014c
@ -143,7 +143,7 @@ func mutexPreferLowLatency(l *mutex) bool {
|
||||
}
|
||||
|
||||
func mutexContended(l *mutex) bool {
|
||||
return atomic.Loaduintptr(&l.key) > mutexLocked
|
||||
return atomic.Loaduintptr(&l.key)&^mutexMMask != 0
|
||||
}
|
||||
|
||||
func lock(l *mutex) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user