aboutsummaryrefslogtreecommitdiff
path: root/src/runtime/signal_unix.go
diff options
context:
space:
mode:
authorCherry Zhang <cherryyz@google.com>2020-06-26 11:57:08 -0400
committerCherry Zhang <cherryyz@google.com>2020-06-26 17:07:58 +0000
commitd1015f3e58e50c3e6f958391a9174fc15e030e83 (patch)
treed6b79551fbc2ed6fe0ac8a03881dd2b95d2b4273 /src/runtime/signal_unix.go
parentc143a5f2a692c2da6a5d29ca9a9462df3a17e0dc (diff)
downloadgo-d1015f3e58e50c3e6f958391a9174fc15e030e83.tar.gz
go-d1015f3e58e50c3e6f958391a9174fc15e030e83.zip
runtime: don't preempt if preemption is disabled
If asyncpreemptoff is set, don't preempt upon receiving a SIGURG. Fixes #38531. Change-Id: I6d9a828b45c199d3e479cbdfe17a896a40d540f9 Reviewed-on: https://go-review.googlesource.com/c/go/+/240121 Run-TryBot: Cherry Zhang <cherryyz@google.com> Reviewed-by: Keith Randall <khr@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
Diffstat (limited to 'src/runtime/signal_unix.go')
-rw-r--r--src/runtime/signal_unix.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/runtime/signal_unix.go b/src/runtime/signal_unix.go
index ba3e21ae2e..dd6d79f8ec 100644
--- a/src/runtime/signal_unix.go
+++ b/src/runtime/signal_unix.go
@@ -536,7 +536,7 @@ func sighandler(sig uint32, info *siginfo, ctxt unsafe.Pointer, gp *g) {
return
}
- if sig == sigPreempt {
+ if sig == sigPreempt && debug.asyncpreemptoff == 0 {
// Might be a preemption signal.
doSigPreempt(gp, c)
// Even if this was definitely a preemption signal, it