aboutsummaryrefslogtreecommitdiff
path: root/src/runtime/sigqueue.go
diff options
context:
space:
mode:
authorRuss Cox <rsc@golang.org>2014-11-15 08:00:38 -0500
committerRuss Cox <rsc@golang.org>2014-11-15 08:00:38 -0500
commit0fcf54b3d2bc42a947c65e9a520d078b671f8432 (patch)
tree071014526059897ceef47c43e5a24ddc0a57b636 /src/runtime/sigqueue.go
parent9ef4e5610809780555260f386d6e20f3df87c6ce (diff)
parent5fce15a2a3cd94427bb9979d73acf14013ec7f31 (diff)
downloadgo-0fcf54b3d2bc42a947c65e9a520d078b671f8432.tar.xz
[dev.garbage] all: merge dev.cc into dev.garbage
The garbage collector is now written in Go. There is plenty to clean up (just like on dev.cc). all.bash passes on darwin/amd64, darwin/386, linux/amd64, linux/386. TBR=rlh R=austin, rlh, bradfitz CC=golang-codereviews https://golang.org/cl/173250043
Diffstat (limited to 'src/runtime/sigqueue.go')
-rw-r--r--src/runtime/sigqueue.go21
1 files changed, 3 insertions, 18 deletions
diff --git a/src/runtime/sigqueue.go b/src/runtime/sigqueue.go
index 2d9c24d2d2..82ead228fa 100644
--- a/src/runtime/sigqueue.go
+++ b/src/runtime/sigqueue.go
@@ -45,7 +45,7 @@ const (
// Called from sighandler to send a signal back out of the signal handling thread.
// Reports whether the signal was sent. If not, the caller typically crashes the program.
-func sigsend(s int32) bool {
+func sigsend(s uint32) bool {
bit := uint32(1) << uint(s&31)
if !sig.inuse || s < 0 || int(s) >= 32*len(sig.wanted) || sig.wanted[s/32]&bit == 0 {
return false
@@ -139,7 +139,7 @@ func signal_enable(s uint32) {
return
}
sig.wanted[s/32] |= 1 << (s & 31)
- sigenable_go(s)
+ sigenable(s)
}
// Must only be called from a single goroutine at a time.
@@ -148,7 +148,7 @@ func signal_disable(s uint32) {
return
}
sig.wanted[s/32] &^= 1 << (s & 31)
- sigdisable_go(s)
+ sigdisable(s)
}
// This runs on a foreign stack, without an m or a g. No stack split.
@@ -156,18 +156,3 @@ func signal_disable(s uint32) {
func badsignal(sig uintptr) {
cgocallback(unsafe.Pointer(funcPC(sigsend)), noescape(unsafe.Pointer(&sig)), unsafe.Sizeof(sig))
}
-
-func sigenable_m()
-func sigdisable_m()
-
-func sigenable_go(s uint32) {
- g := getg()
- g.m.scalararg[0] = uintptr(s)
- onM(sigenable_m)
-}
-
-func sigdisable_go(s uint32) {
- g := getg()
- g.m.scalararg[0] = uintptr(s)
- onM(sigdisable_m)
-}