runtime: preserve signal stack when calling Go on C thread

When calling a Go function on a C thread, if the C thread already has an
alternate signal stack, use that signal stack instead of installing a
new one.

Update #9896.

Change-Id: I62aa3a6a4a1dc4040fca050757299c8e6736987c
Reviewed-on: https://go-review.googlesource.com/18108
Reviewed-by: Russ Cox <rsc@golang.org>
This commit is contained in:
Ian Lance Taylor 2015-12-23 18:38:18 -08:00
parent 62c280ac1c
commit a7cad52e04
11 changed files with 383 additions and 14 deletions

View file

@ -303,6 +303,7 @@ type m struct {
spinning bool // m is out of work and is actively looking for work
blocked bool // m is blocked on a note
inwb bool // m is executing a write barrier
newSigstack bool // minit on C thread called sigaltstack
printlock int8
fastrand uint32
ncgocall uint64 // number of cgo calls in total