Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(130)

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 Created 11 years, 3 months ago
Right Patch Set: diff -r 3fe40a41018d https://code.google.com/p/go Created 11 years, 3 months ago
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
Right: Side by side diff | Download
« no previous file with change/comment | « src/cmd/go/build.go ('k') | no next file » | no next file with change/comment »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
LEFTRIGHT
(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 }
LEFTRIGHT

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b