]> Cypherpunks repositories - gostls13.git/commit
runtime: don't send preemption signal if there is a signal pending
authorCherry Zhang <cherryyz@google.com>
Tue, 17 Mar 2020 00:08:00 +0000 (20:08 -0400)
committerCherry Zhang <cherryyz@google.com>
Wed, 18 Mar 2020 16:00:44 +0000 (16:00 +0000)
commit0c0e8f224d5724e317952f77d215a752a3a7b7d9
treec190a79fde5ddd44ab0987067accfc3ae84b597e
parent6412750f32224f6820f781d09b2092c5c358dddc
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.

Fixes #37741.

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>
src/runtime/runtime2.go
src/runtime/signal_unix.go