aboutsummaryrefslogtreecommitdiff
path: root/libgo/go/os/signal
diff options
context:
space:
mode:
authorIan Lance Taylor <ian@gcc.gnu.org>2016-07-22 18:15:38 +0000
committerIan Lance Taylor <ian@gcc.gnu.org>2016-07-22 18:15:38 +0000
commit22b955cca564a9a3a5b8c9d9dd1e295b7943c128 (patch)
treeabdbd898676e1f853fca2d7e031d105d7ebcf676 /libgo/go/os/signal
parent9d04a3af4c6491536badf6bde9707c907e4d196b (diff)
downloadgcc-22b955cca564a9a3a5b8c9d9dd1e295b7943c128.zip
gcc-22b955cca564a9a3a5b8c9d9dd1e295b7943c128.tar.gz
gcc-22b955cca564a9a3a5b8c9d9dd1e295b7943c128.tar.bz2
libgo: update to go1.7rc3
Reviewed-on: https://go-review.googlesource.com/25150 From-SVN: r238662
Diffstat (limited to 'libgo/go/os/signal')
-rw-r--r--libgo/go/os/signal/doc.go6
-rw-r--r--libgo/go/os/signal/signal.go2
-rw-r--r--libgo/go/os/signal/signal_test.go13
3 files changed, 17 insertions, 4 deletions
diff --git a/libgo/go/os/signal/doc.go b/libgo/go/os/signal/doc.go
index 80e66cf..73b01a2 100644
--- a/libgo/go/os/signal/doc.go
+++ b/libgo/go/os/signal/doc.go
@@ -11,7 +11,7 @@ package on Windows and Plan 9, see below.
Types of signals
The signals SIGKILL and SIGSTOP may not be caught by a program, and
-therefore can not be affected by this package.
+therefore cannot be affected by this package.
Synchronous signals are signals triggered by errors in program
execution: SIGBUS, SIGFPE, and SIGSEGV. These are only considered
@@ -205,8 +205,8 @@ before raising the signal.
Windows
On Windows a ^C (Control-C) or ^BREAK (Control-Break) normally cause
-the program to exit. If Notify is called for os.SIGINT, ^C or ^BREAK
-will cause os.SIGINT to be sent on the channel, and the program will
+the program to exit. If Notify is called for os.Interrupt, ^C or ^BREAK
+will cause os.Interrupt to be sent on the channel, and the program will
not exit. If Reset is called, or Stop is called on all channels passed
to Notify, then the default behavior will be restored.
diff --git a/libgo/go/os/signal/signal.go b/libgo/go/os/signal/signal.go
index 2e6f186..c1376da 100644
--- a/libgo/go/os/signal/signal.go
+++ b/libgo/go/os/signal/signal.go
@@ -79,7 +79,7 @@ func Ignore(sig ...os.Signal) {
//
// Package signal will not block sending to c: the caller must ensure
// that c has sufficient buffer space to keep up with the expected
-// signal rate. For a channel used for notification of just one signal value,
+// signal rate. For a channel used for notification of just one signal value,
// a buffer of size 1 is sufficient.
//
// It is allowed to call Notify multiple times with the same channel:
diff --git a/libgo/go/os/signal/signal_test.go b/libgo/go/os/signal/signal_test.go
index 56d786e..406102c 100644
--- a/libgo/go/os/signal/signal_test.go
+++ b/libgo/go/os/signal/signal_test.go
@@ -139,6 +139,19 @@ func testCancel(t *testing.T, ignore bool) {
Reset(syscall.SIGWINCH, syscall.SIGHUP)
}
+ // At this point we do not expect any further signals on c1.
+ // However, it is just barely possible that the initial SIGWINCH
+ // at the start of this function was delivered after we called
+ // Notify on c1. In that case the waitSig for SIGWINCH may have
+ // picked up that initial SIGWINCH, and the second SIGWINCH may
+ // then have been delivered on the channel. This sequence of events
+ // may have caused issue 15661.
+ // So, read any possible signal from the channel now.
+ select {
+ case <-c1:
+ default:
+ }
+
// Send this process a SIGWINCH. It should be ignored.
syscall.Kill(syscall.Getpid(), syscall.SIGWINCH)