diff options
| author | Ian Lance Taylor <iant@golang.org> | 2015-12-26 09:51:59 -0800 |
|---|---|---|
| committer | Ian Lance Taylor <iant@golang.org> | 2016-01-09 00:58:38 +0000 |
| commit | 21b4f234c716cb35ca0c7e02f81b760cce8f7f37 (patch) | |
| tree | 93365efee4bf6a668719d304603e519a492c4e74 /src/runtime/rt0_linux_amd64.s | |
| parent | 0b3807a2a370a55e06040cafa85a76b90d06eb6f (diff) | |
| download | go-21b4f234c716cb35ca0c7e02f81b760cce8f7f37.tar.xz | |
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>
Diffstat (limited to 'src/runtime/rt0_linux_amd64.s')
| -rw-r--r-- | src/runtime/rt0_linux_amd64.s | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/runtime/rt0_linux_amd64.s b/src/runtime/rt0_linux_amd64.s index 726b550d35..564b51c0b3 100644 --- a/src/runtime/rt0_linux_amd64.s +++ b/src/runtime/rt0_linux_amd64.s @@ -23,6 +23,10 @@ TEXT _rt0_amd64_linux_lib(SB),NOSPLIT,$0x48 MOVQ DI, _rt0_amd64_linux_lib_argc<>(SB) MOVQ SI, _rt0_amd64_linux_lib_argv<>(SB) + // Synchronous initialization. + MOVQ $runtimeĀ·libpreinit(SB), AX + CALL AX + // Create a new thread to do the runtime initialization and return. MOVQ _cgo_sys_thread_create(SB), AX TESTQ AX, AX |
