aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
author徐志强 <shore.cloud@gmail.com>2019-12-11 05:51:33 +0000
committerBrad Fitzpatrick <bradfitz@golang.org>2020-05-07 04:59:13 +0000
commit85162292af601a1bebb8ec3d63314e39b648829f (patch)
treefb8fdeabecffbace6ac83437ef7ad3ba8467333e /src
parent9e8157805fed930c292d5593aab3016ce6d9c8ed (diff)
downloadgo-85162292af601a1bebb8ec3d63314e39b648829f.tar.xz
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: 7a0aa25e555edd901add25a1101e7b145d1f3bd8 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>
Diffstat (limited to 'src')
-rw-r--r--src/runtime/proc.go6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/runtime/proc.go b/src/runtime/proc.go
index bd114496b2..fe7da0bc87 100644
--- a/src/runtime/proc.go
+++ b/src/runtime/proc.go
@@ -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
}
}