summaryrefslogtreecommitdiff
path: root/src/runtime/stubs.go
diff options
context:
space:
mode:
authorKeith Randall <khr@golang.org>2014-09-16 17:26:16 -0700
committerKeith Randall <khr@golang.org>2014-09-16 17:26:16 -0700
commitbf1cf8a2e4e179e45a74f0daf3267e86cd92d659 (patch)
treec503b1b3cb2256ac04331799a10f18bcfd4d6118 /src/runtime/stubs.go
parent9eb03ec6a2705273aef1747cc008a0f4a8d9da32 (diff)
downloadgo-bf1cf8a2e4e179e45a74f0daf3267e86cd92d659.tar.gz
runtime: always run semacquire on the G stack
semacquire might need to park the currently running G. It can only park if called from the G stack (because it has no way of saving the M stack state). So all calls to semacquire must come from the G stack. The three violators are GOMAXPROCS, ReadMemStats, and WriteHeapDump. This change moves the semacquire call earlier, out of their C code and into their Go code. This seldom caused bugs because semacquire seldom actually had to park the caller. But it did happen intermittently. Fixes issue 8749 LGTM=dvyukov R=golang-codereviews, dvyukov, bradfitz CC=golang-codereviews https://codereview.appspot.com/144940043
Diffstat (limited to 'src/runtime/stubs.go')
-rw-r--r--src/runtime/stubs.go2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/runtime/stubs.go b/src/runtime/stubs.go
index ff443c4cd..2e6aadca7 100644
--- a/src/runtime/stubs.go
+++ b/src/runtime/stubs.go
@@ -119,6 +119,8 @@ func deferproc_m()
func goexit_m()
func startpanic_m()
func dopanic_m()
+func readmemstats_m()
+func writeheapdump_m()
// memclr clears n bytes starting at ptr.
// in memclr_*.s