dsymonds avatar dsymonds committed 01be178

os/signal: move to exp/signal.

Fixes issue 2816.

R=golang-dev, r
CC=golang-dev
http://codereview.appspot.com/5609048

Comments (0)

Files changed (6)

 <ul>
 <li><code>ebnf</code></li>
 <li><code>go/types</code></li>
-<li><code>http/spdy</code></li>
+<li><code>os/signal</code></li>
 </ul>
 
 <p>
 <ul>
 <li><code>ebnf</code></li>
 <li><code>go/types</code></li>
-<li><code>http/spdy</code></li>
+<li><code>os/signal</code></li>
 </ul>
 
 <p>

src/pkg/exp/signal/signal.go

+// Copyright 2009 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+// +build darwin freebsd linux netbsd openbsd
+
+// Package signal implements operating system-independent signal handling.
+package signal
+
+import (
+	"os"
+	"runtime"
+)
+
+// Incoming is the global signal channel.
+// All signals received by the program will be delivered to this channel.
+var Incoming <-chan os.Signal
+
+func process(ch chan<- os.Signal) {
+	for {
+		var mask uint32 = runtime.Sigrecv()
+		for sig := uint(0); sig < 32; sig++ {
+			if mask&(1<<sig) != 0 {
+				ch <- os.UnixSignal(sig)
+			}
+		}
+	}
+}
+
+func init() {
+	runtime.Siginit()
+	ch := make(chan os.Signal) // Done here so Incoming can have type <-chan Signal
+	Incoming = ch
+	go process(ch)
+}
+
+// BUG(rsc): This package is unavailable on Plan 9 and Windows.

src/pkg/exp/signal/signal_test.go

+// Copyright 2009 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+// +build darwin freebsd linux netbsd openbsd
+
+package signal
+
+import (
+	"os"
+	"syscall"
+	"testing"
+)
+
+const sighup = os.UnixSignal(syscall.SIGHUP)
+
+func TestSignal(t *testing.T) {
+	// Send this process a SIGHUP.
+	syscall.Syscall(syscall.SYS_KILL, uintptr(syscall.Getpid()), syscall.SIGHUP, 0)
+
+	if sig := (<-Incoming).(os.UnixSignal); sig != sighup {
+		t.Errorf("signal was %v, want %v", sig, sighup)
+	}
+}

src/pkg/os/signal/signal.go

-// Copyright 2009 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-// +build darwin freebsd linux netbsd openbsd
-
-// Package signal implements operating system-independent signal handling.
-package signal
-
-import (
-	"os"
-	"runtime"
-)
-
-// Incoming is the global signal channel.
-// All signals received by the program will be delivered to this channel.
-var Incoming <-chan os.Signal
-
-func process(ch chan<- os.Signal) {
-	for {
-		var mask uint32 = runtime.Sigrecv()
-		for sig := uint(0); sig < 32; sig++ {
-			if mask&(1<<sig) != 0 {
-				ch <- os.UnixSignal(sig)
-			}
-		}
-	}
-}
-
-func init() {
-	runtime.Siginit()
-	ch := make(chan os.Signal) // Done here so Incoming can have type <-chan Signal
-	Incoming = ch
-	go process(ch)
-}
-
-// BUG(rsc): This package is unavailable on Plan 9 and Windows.

src/pkg/os/signal/signal_test.go

-// Copyright 2009 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-// +build darwin freebsd linux netbsd openbsd
-
-package signal
-
-import (
-	"os"
-	"syscall"
-	"testing"
-)
-
-const sighup = os.UnixSignal(syscall.SIGHUP)
-
-func TestSignal(t *testing.T) {
-	// Send this process a SIGHUP.
-	syscall.Syscall(syscall.SYS_KILL, uintptr(syscall.Getpid()), syscall.SIGHUP, 0)
-
-	if sig := (<-Incoming).(os.UnixSignal); sig != sighup {
-		t.Errorf("signal was %v, want %v", sig, sighup)
-	}
-}
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.