runtime: for c-archive/c-shared, install signal handlers synchronously

The previous behaviour of installing the signal handlers in a separate
thread meant that Go initialization raced with non-Go initialization if
the non-Go initialization also wanted to install signal handlers.  Make
installing signal handlers synchronous so that the process-wide behavior
is predictable.

Update #9896.

Change-Id: Ice24299877ec46f8518b072a381932d273096a32
Reviewed-on: https://go-review.googlesource.com/18150
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: David Crawshaw <crawshaw@golang.org>
This commit is contained in:
Ian Lance Taylor 2015-12-26 09:51:59 -08:00
parent 0b3807a2a3
commit 21b4f234c7
23 changed files with 200 additions and 12 deletions

View file

@ -1088,7 +1088,7 @@ func mstart1() {
cgoHasExtraM = true
newextram()
}
initsig()
initsig(false)
}
if fn := _g_.m.mstartfn; fn != nil {