]> Cypherpunks repositories - gostls13.git/commit
[release-branch.go1.14] runtime: don't send preemption signal if there is a signal...
authorCherry Zhang <cherryyz@google.com>
Tue, 17 Mar 2020 00:08:00 +0000 (20:08 -0400)
committerCarlos Amedee <carlos@golang.org>
Wed, 18 Mar 2020 18:38:30 +0000 (18:38 +0000)
commite577ba98d8d9f4464d6dfaaf2fa51d328233c81e
tree019caafc845254edee73864783d85779f649e1c1
parent229247d33b717ce7729e43a8fde3a095e376cf3d
[release-branch.go1.14] runtime: don't send preemption signal if there is a signal pending

If multiple threads call preemptone to preempt the same M, it may
send many signals to the same M such that it hardly make
progress, causing live-lock problem. Only send a signal if there
isn't already one pending.

Updates #37741.
Fixes #37833.

Change-Id: Id94adb0b95acbd18b23abe637a8dcd81ab41b452
Reviewed-on: https://go-review.googlesource.com/c/go/+/223737
Run-TryBot: Cherry Zhang <cherryyz@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Keith Randall <khr@golang.org>
(cherry picked from commit 0c0e8f224d5724e317952f77d215a752a3a7b7d9)
Reviewed-on: https://go-review.googlesource.com/c/go/+/223939
Reviewed-by: Austin Clements <austin@google.com>
src/runtime/runtime2.go
src/runtime/signal_unix.go