Add LOOP_VINFO_MAX_VECT_FACTOR
[official-gcc.git] / libgo / go / cmd / go / signal.go
blobe8ba0d36556ad4efd9f2a83e8c8b37cf0e95c24e
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.
5 package main
7 import (
8 "os"
9 "os/signal"
10 "sync"
13 // interrupted is closed, if go process is interrupted.
14 var interrupted = make(chan struct{})
16 // processSignals setups signal handler.
17 func processSignals() {
18 sig := make(chan os.Signal)
19 signal.Notify(sig, signalsToIgnore...)
20 go func() {
21 <-sig
22 close(interrupted)
23 }()
26 var onceProcessSignals sync.Once
28 // startSigHandlers start signal handlers.
29 func startSigHandlers() {
30 onceProcessSignals.Do(processSignals)