1
0
mirror of https://github.com/golang/go synced 2024-11-12 00:20:22 -07:00

runtime: call osyield directly in lockextra

The `yield := osyield` line doesn't serve any purpose,  it's committed in `2015`, time to delete that line:)

Change-Id: I382d4d32cf320f054f011f3b6684c868cbcb0ff2
GitHub-Last-Rev: 7a0aa25e55
GitHub-Pull-Request: golang/go#36078
Reviewed-on: https://go-review.googlesource.com/c/go/+/210837
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
This commit is contained in:
徐志强 2019-12-11 05:51:33 +00:00 committed by Brad Fitzpatrick
parent 9e8157805f
commit 85162292af

View File

@ -1691,8 +1691,7 @@ func lockextra(nilokay bool) *m {
for {
old := atomic.Loaduintptr(&extram)
if old == locked {
yield := osyield
yield()
osyield()
continue
}
if old == 0 && !nilokay {
@ -1709,8 +1708,7 @@ func lockextra(nilokay bool) *m {
if atomic.Casuintptr(&extram, old, locked) {
return (*m)(unsafe.Pointer(old))
}
yield := osyield
yield()
osyield()
continue
}
}