From: Dmitry Vyukov Date: Fri, 26 Feb 2016 09:43:09 +0000 (+0100) Subject: runtime: unwire g/m in dropg always X-Git-Tag: go1.7beta1~1697 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=bdc14698f8b79e9629a8321d4f904c3275f8ffed;p=gostls13.git runtime: unwire g/m in dropg always Currently dropg does not unwire locked g/m. This is unnecessary distiction between locked and non-locked g/m. We always restart goroutines with execute which re-wires g/m. First, this produces false sense that this distinction is necessary. Second, it can confuse some sanity and cross checks. For example, if we check that g/m are unwired before we wire them in execute, the check will fail for locked g/m. I've hit this while doing some race detector changes, When we deschedule a goroutine and run scheduler code, m.curg is generally nil, but not for locked ms. Remove the distinction. Change-Id: I3b87a28ff343baa1d564aab1f821b582a84dee07 Reviewed-on: https://go-review.googlesource.com/19950 Reviewed-by: Austin Clements Run-TryBot: Austin Clements TryBot-Result: Gobot Gobot --- diff --git a/src/runtime/proc.go b/src/runtime/proc.go index d9c38f9cb0..16237e98ec 100644 --- a/src/runtime/proc.go +++ b/src/runtime/proc.go @@ -2081,10 +2081,8 @@ top: func dropg() { _g_ := getg() - if _g_.m.lockedg == nil { - _g_.m.curg.m = nil - _g_.m.curg = nil - } + _g_.m.curg.m = nil + _g_.m.curg = nil } func parkunlock_c(gp *g, lock unsafe.Pointer) bool {