]> Cypherpunks.ru repositories - gostls13.git/commit
runtime: don't test sig.inuse in sigsend
authorIan Lance Taylor <iant@golang.org>
Wed, 21 Apr 2021 00:02:37 +0000 (17:02 -0700)
committerIan Lance Taylor <iant@golang.org>
Wed, 21 Apr 2021 02:39:25 +0000 (02:39 +0000)
commitc33ced6d8a2bb4db6896ff36cfcaac2bbdf123d1
tree055d10241924976a5c0c7474eb741a686a1a9900
parent190cb937f7acdc1568a09c0cbbe1c14031c94ca9
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>
src/runtime/sigqueue.go