1
0
mirror of https://github.com/golang/go synced 2024-09-30 05:34:35 -06:00

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>
This commit is contained in:
Cherry Zhang 2020-06-26 11:57:08 -04:00
parent c143a5f2a6
commit d1015f3e58

View File

@ -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