From: Cherry Zhang Date: Fri, 26 Jun 2020 15:57:08 +0000 (-0400) Subject: runtime: don't preempt if preemption is disabled X-Git-Tag: go1.15rc1~58 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=d1015f3e58e50c3e6f958391a9174fc15e030e83;p=gostls13.git 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 Reviewed-by: Keith Randall TryBot-Result: Gobot Gobot --- 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