From: David Crawshaw Date: Fri, 26 Aug 2016 02:04:04 +0000 (-0400) Subject: runtime: avoid dependence on main symbol X-Git-Tag: go1.8beta1~1279 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=8607bed7445100993938ee96a028627461fce9d3;p=gostls13.git runtime: avoid dependence on main symbol For -buildmode=plugin, this lets the linker drop the main.main symbol out of the binary while including most of the runtime. (In the future it should be possible to drop the entire runtime package from plugins.) Change-Id: I3e7a024ddf5cc945e3d8b84bf37a0b7cb2a00eb6 Reviewed-on: https://go-review.googlesource.com/27821 Run-TryBot: David Crawshaw TryBot-Result: Gobot Gobot Reviewed-by: Ian Lance Taylor --- diff --git a/src/runtime/proc.go b/src/runtime/proc.go index 67e8447d46..4dd2bd2005 100644 --- a/src/runtime/proc.go +++ b/src/runtime/proc.go @@ -2806,7 +2806,7 @@ func newproc1(fn *funcval, argp *uint8, narg int32, nret int32, callerpc uintptr } runqput(_p_, newg, true) - if atomic.Load(&sched.npidle) != 0 && atomic.Load(&sched.nmspinning) == 0 && unsafe.Pointer(fn.fn) != unsafe.Pointer(funcPC(main)) { + if atomic.Load(&sched.npidle) != 0 && atomic.Load(&sched.nmspinning) == 0 && runtimeInitTime != 0 { wakep() } _g_.m.locks--