From 2686e7494845dae877e0efb4ff786c672b2cd2ef Mon Sep 17 00:00:00 2001 From: Richard Musiol Date: Thu, 10 Oct 2019 22:38:26 +0200 Subject: runtime: make goroutine for wasm async events short-lived An extra goroutine is necessary to handle asynchronous events on wasm. However, we do not want this goroutine to exist all the time. This change makes it short-lived, so it ends after the asynchronous event was handled. Fixes #34768 Change-Id: I24626ff0af9d803a01ebe33fbb584d04d2059a44 Reviewed-on: https://go-review.googlesource.com/c/go/+/200497 Run-TryBot: Richard Musiol TryBot-Result: Gobot Gobot Reviewed-by: Cherry Zhang --- src/runtime/traceback.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/runtime/traceback.go') diff --git a/src/runtime/traceback.go b/src/runtime/traceback.go index 96fb33c04b..0e4b75a7e6 100644 --- a/src/runtime/traceback.go +++ b/src/runtime/traceback.go @@ -998,7 +998,7 @@ func topofstack(f funcInfo, g0 bool) bool { // isSystemGoroutine reports whether the goroutine g must be omitted // in stack dumps and deadlock detector. This is any goroutine that // starts at a runtime.* entry point, except for runtime.main, -// runtime.handleAsyncEvents (wasm only) and sometimes runtime.runfinq. +// runtime.handleAsyncEvent (wasm only) and sometimes runtime.runfinq. // // If fixed is true, any goroutine that can vary between user and // system (that is, the finalizer goroutine) is considered a user @@ -1009,7 +1009,7 @@ func isSystemGoroutine(gp *g, fixed bool) bool { if !f.valid() { return false } - if f.funcID == funcID_runtime_main || f.funcID == funcID_handleAsyncEvents { + if f.funcID == funcID_runtime_main || f.funcID == funcID_handleAsyncEvent { return false } if f.funcID == funcID_runfinq { -- cgit v1.3