From 85162292af601a1bebb8ec3d63314e39b648829f Mon Sep 17 00:00:00 2001 From: =?utf8?q?=E5=BE=90=E5=BF=97=E5=BC=BA?= Date: Wed, 11 Dec 2019 05:51:33 +0000 Subject: [PATCH] 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 TryBot-Result: Gobot Gobot Reviewed-by: Ian Lance Taylor --- src/runtime/proc.go | 6 ++---- 1 file 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 } } -- 2.50.0