Skip to content
Snippets Groups Projects
Commit 7ce45a01 authored by Rhys Hiltner's avatar Rhys Hiltner Committed by Gopher Robot
Browse files

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: default avatarMichael 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: default avatarJunyang Shao <shaojunyang@google.com>
parent 95611c0e
No related branches found
No related tags found
No related merge requests found
......@@ -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) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment