]> Cypherpunks repositories - gostls13.git/commit
syscall/js: show goroutine stack traces on deadlock
authorRichard Musiol <mail@richard-musiol.de>
Sat, 14 Jul 2018 10:19:36 +0000 (12:19 +0200)
committerBrad Fitzpatrick <bradfitz@golang.org>
Thu, 19 Jul 2018 19:00:52 +0000 (19:00 +0000)
commitfec97c0aa76eb19bd58ca33001063b726ab9ce27
tree00add868e942268eb4aff021bd16772b9d617caa
parentca642bb326c9eccd880f242c76f1e494d98efbc0
syscall/js: show goroutine stack traces on deadlock

When using callbacks, it is not necessarily a deadlock if there is no
runnable goroutine, since a callback might still be pending. If there
is no callback pending, Node.js simply exits with exit code zero,
which is not desired if the Go program is still considered running.
This is why an explicit check on exit is used to trigger the "deadlock"
error. This CL makes it so this is Go's normal "deadlock" error, which
includes the stack traces of all goroutines.

Updates #26382

Change-Id: If88486684d0517a64f570009a5ea0ad082679a54
Reviewed-on: https://go-review.googlesource.com/123936
Run-TryBot: Richard Musiol <neelance@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
misc/wasm/wasm_exec.js
src/syscall/js/callback.go
src/syscall/js/js.go