]> Cypherpunks.ru repositories - gostls13.git/commit
runtime: linux iscgo support for not blocking nptl signals
authorAndrew G. Morgan <agm@google.com>
Fri, 13 Nov 2020 05:19:52 +0000 (21:19 -0800)
committerIan Lance Taylor <iant@golang.org>
Wed, 23 Dec 2020 02:10:51 +0000 (02:10 +0000)
commitb0b0d9828308368e9fbd59ec5de55801f568f720
tree749e40dadc88de8406fa3617592d9a6ac8c64e00
parent223331fc0cf5b23fbb9999eb1164b23695ef612a
runtime: linux iscgo support for not blocking nptl signals

Under linux+cgo, OS threads are launched via pthread_create().
This abstraction, under linux, requires we avoid blocking
signals 32,33 and 34 indefinitely because they are needed to
reliably execute POSIX-semantics threading in glibc and/or musl.

When blocking signals the go runtime generally re-enables them
quickly. However, when a thread exits (under cgo, this is
via a return from mstart()), we avoid a deadlock in C-code by
not blocking these three signals.

Fixes #42494

Change-Id: I02dfb2480a1f97d11679e0c4b132b51bddbe4c14
Reviewed-on: https://go-review.googlesource.com/c/go/+/269799
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Austin Clements <austin@google.com>
Trust: Tobias Klauser <tobias.klauser@gmail.com>
src/runtime/os_js.go
src/runtime/os_linux.go
src/runtime/os_plan9.go
src/runtime/os_windows.go
src/runtime/proc.go
src/runtime/signal_unix.go
src/syscall/syscall_linux_test.go