mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
runtime: don't test sig.inuse in sigsend
Signals can be delivered on a different thread. There is no necessary happens-before relationship between setting sig.inuse in signal_enable and checking it in sigsend. It is theoretically possible, if unlikely, that sig.inuse is set by thread 1, thread 2 receives a signal, does not see that sig.inuse is set, and discards the signal. This could happen if the signal is received immediately after the first call to signal_enable. For #33174 Change-Id: Idb0f1c77847b7d4d418bd139e801c0c4460531d2 Reviewed-on: https://go-review.googlesource.com/c/go/+/312131 Trust: Ian Lance Taylor <iant@golang.org> Run-TryBot: Ian Lance Taylor <iant@golang.org> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Bryan C. Mills <bcmills@google.com>
This commit is contained in:
parent
190cb937f7
commit
c33ced6d8a
1 changed files with 1 additions and 1 deletions
|
|
@ -72,7 +72,7 @@ const (
|
||||||
// It runs from the signal handler, so it's limited in what it can do.
|
// It runs from the signal handler, so it's limited in what it can do.
|
||||||
func sigsend(s uint32) bool {
|
func sigsend(s uint32) bool {
|
||||||
bit := uint32(1) << uint(s&31)
|
bit := uint32(1) << uint(s&31)
|
||||||
if !sig.inuse || s >= uint32(32*len(sig.wanted)) {
|
if s >= uint32(32*len(sig.wanted)) {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue