diff options
author | Cherry Zhang <cherryyz@google.com> | 2020-10-24 16:34:12 -0400 |
---|---|---|
committer | Cherry Zhang <cherryyz@google.com> | 2020-10-28 14:00:36 +0000 |
commit | 7c8d82e92be894fe02b1a0bee775cf803c6849c1 (patch) | |
tree | 0f5a8375e62dbe53147baee2c1f4d5879f7b9fea /src/runtime/signal_unix.go | |
parent | a0a44397e91055cb92d5a69e3851d628a7227971 (diff) | |
download | go-7c8d82e92be894fe02b1a0bee775cf803c6849c1.tar.gz go-7c8d82e92be894fe02b1a0bee775cf803c6849c1.zip |
runtime: always enable async preemption on darwin/arm64
Now that we have the G register saved, we can enable asynchronous
preemption for pure Go programs on darwin/arm64.
Updates #38485, #36365.
Change-Id: Ic654fa4dce369efe289b38d59cf1a184b358fe9e
Reviewed-on: https://go-review.googlesource.com/c/go/+/265120
Trust: Cherry Zhang <cherryyz@google.com>
Reviewed-by: Austin Clements <austin@google.com>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Diffstat (limited to 'src/runtime/signal_unix.go')
-rw-r--r-- | src/runtime/signal_unix.go | 11 |
1 files changed, 0 insertions, 11 deletions
diff --git a/src/runtime/signal_unix.go b/src/runtime/signal_unix.go index bf4a319b37..6aad079f03 100644 --- a/src/runtime/signal_unix.go +++ b/src/runtime/signal_unix.go @@ -350,17 +350,6 @@ const preemptMSupported = true // safe-point, it will preempt the goroutine. It always atomically // increments mp.preemptGen after handling a preemption request. func preemptM(mp *m) { - if (GOOS == "darwin" || GOOS == "ios") && GOARCH == "arm64" && !iscgo { - // On darwin, we use libc calls, and cgo is required on ARM64 - // so we have TLS set up to save/restore G during C calls. If cgo is - // absent, we cannot save/restore G in TLS, and if a signal is - // received during C execution we cannot get the G. Therefore don't - // send signals. - // This can only happen in the go_bootstrap program (otherwise cgo is - // required). - return - } - // On Darwin, don't try to preempt threads during exec. // Issue #41702. if GOOS == "darwin" { |