Delta Between Two Patch Sets: src/cmd/go/signal.go
Issue 6943043 :
cmd/go: unblock all workers on signal (Closed)
Left Patch Set: code review 6943043: cmd/go: cleanup all blocked workers
Right Patch Set: diff -r 3fe40a41018d https://code.google.com/p/go
Use n/p to move between diff chunks;
N/P to move between comments.
Please Sign in to add in-line comments.
Jump to:
src/cmd/go/build.go
src/cmd/go/signal.go
LEFT RIGHT
(no file at all) 1 // Copyright 2012 The Go Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style
3 // license that can be found in the LICENSE file.
4
5 package main
6
7 import (
8 "os"
9 "os/signal"
10 "sync"
11 )
12
13 var interrupted = make(chan struct{})
14
15 // ignoreSignals setup for some signals to be ignored.
16 func ignoreSignals() {
17 sig := make(chan os.Signal)
18 signal.Notify(sig, signalsToIgnore...)
19 go func() {
20 for _ = range sig {
21 close(interrupted)
22 return
23 }
24 }()
25 }
26
27 var onceIgnoreSignals sync.Once
28
29 // startSigHandlers start signal handlers.
30 func startSigHandlers() {
31 onceIgnoreSignals.Do(ignoreSignals)
32 }
LEFT RIGHT