]> Cypherpunks repositories - gostls13.git/commit
runtime: use atomic ops for fwdSig, make sigtable immutable
authorIan Lance Taylor <iant@golang.org>
Sat, 4 Feb 2017 05:13:30 +0000 (21:13 -0800)
committerIan Lance Taylor <iant@golang.org>
Wed, 8 Feb 2017 04:14:41 +0000 (04:14 +0000)
commit87ad863f359de3760578acb7f7a4d7e333c9cdc8
treeb586db826b070743c97ba29bd4ddf70cb1ac57c0
parent14c2849c3ebe498971413ee5e8c9780fabc8578e
runtime: use atomic ops for fwdSig, make sigtable immutable

The fwdSig array is accessed by the signal handler, which may run in
parallel with other threads manipulating it via the os/signal package.
Use atomic accesses to ensure that there are no problems.

Move the _SigHandling flag out of the sigtable array. This makes sigtable
immutable and safe to read from the signal handler.

Change-Id: Icfa407518c4ebe1da38580920ced764898dfc9ad
Reviewed-on: https://go-review.googlesource.com/36321
Run-TryBot: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Austin Clements <austin@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
src/runtime/runtime2.go
src/runtime/signal_unix.go