Skip to content

Commit 7c8d82e

Browse files
committed
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>
1 parent a0a4439 commit 7c8d82e

File tree

1 file changed

+0
-11
lines changed

1 file changed

+0
-11
lines changed

src/runtime/signal_unix.go

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -350,17 +350,6 @@ const preemptMSupported = true
350350
// safe-point, it will preempt the goroutine. It always atomically
351351
// increments mp.preemptGen after handling a preemption request.
352352
func preemptM(mp *m) {
353-
if (GOOS == "darwin" || GOOS == "ios") && GOARCH == "arm64" && !iscgo {
354-
// On darwin, we use libc calls, and cgo is required on ARM64
355-
// so we have TLS set up to save/restore G during C calls. If cgo is
356-
// absent, we cannot save/restore G in TLS, and if a signal is
357-
// received during C execution we cannot get the G. Therefore don't
358-
// send signals.
359-
// This can only happen in the go_bootstrap program (otherwise cgo is
360-
// required).
361-
return
362-
}
363-
364353
// On Darwin, don't try to preempt threads during exec.
365354
// Issue #41702.
366355
if GOOS == "darwin" {

0 commit comments

Comments
 (0)