]> Cypherpunks repositories - gostls13.git/commitdiff
runtime: unify Unix implementations of unminit
authorIan Lance Taylor <iant@golang.org>
Mon, 26 Sep 2016 18:35:55 +0000 (11:35 -0700)
committerIan Lance Taylor <iant@golang.org>
Mon, 26 Sep 2016 19:33:26 +0000 (19:33 +0000)
Change-Id: I2cbb13eb85876ad05a52cbd498a9b86e7a28899c
Reviewed-on: https://go-review.googlesource.com/29772
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
src/runtime/os3_solaris.go
src/runtime/os_darwin.go
src/runtime/os_dragonfly.go
src/runtime/os_freebsd.go
src/runtime/os_linux.go
src/runtime/os_netbsd.go
src/runtime/os_openbsd.go
src/runtime/signal_unix.go

index 715fb60c96d25b013e0096d61e24615ea919cc26..144d9cdc1f5f0135cd1dc52d539e59c52839ec97 100644 (file)
@@ -214,9 +214,7 @@ func minit() {
 
 // Called from dropm to undo the effect of an minit.
 func unminit() {
-       if getg().m.newSigstack {
-               signalstack(nil)
-       }
+       unminitSignals()
 }
 
 func memlimit() uintptr {
index 2ac57d3753c422f1b10459fc7c1a509f82f54eb6..5061dde1c5321d5faaa32372f952905e67b56e5f 100644 (file)
@@ -188,9 +188,7 @@ func minit() {
 // Called from dropm to undo the effect of an minit.
 //go:nosplit
 func unminit() {
-       if getg().m.newSigstack {
-               signalstack(nil)
-       }
+       unminitSignals()
 }
 
 // Mach IPC, to get at semaphores
index f55b93e67e06afac591f21d132f87630e70c2b70..df73346a18a759402102e766247b175843417a38 100644 (file)
@@ -190,9 +190,7 @@ func minit() {
 // Called from dropm to undo the effect of an minit.
 //go:nosplit
 func unminit() {
-       if getg().m.newSigstack {
-               signalstack(nil)
-       }
+       unminitSignals()
 }
 
 func memlimit() uintptr {
index 7c533d4f344fae55b1f0031b103c62d5af6a2527..2fc020e528958594655b61e316c747d71915d7d3 100644 (file)
@@ -180,9 +180,7 @@ func minit() {
 // Called from dropm to undo the effect of an minit.
 //go:nosplit
 func unminit() {
-       if getg().m.newSigstack {
-               signalstack(nil)
-       }
+       unminitSignals()
 }
 
 func memlimit() uintptr {
index 92c3db86165550bbde78d0b2e6426c0c5650a000..52b6b638686357d9454414546571429010efe097 100644 (file)
@@ -266,9 +266,7 @@ func minit() {
 // Called from dropm to undo the effect of an minit.
 //go:nosplit
 func unminit() {
-       if getg().m.newSigstack {
-               signalstack(nil)
-       }
+       unminitSignals()
 }
 
 func memlimit() uintptr {
index 27c1932fd4013e3d6fb6be1f08f86b484b0e26d2..e9c049045511095862e1a8c261fec0f3b34f0a31 100644 (file)
@@ -244,9 +244,7 @@ func minit() {
 // Called from dropm to undo the effect of an minit.
 //go:nosplit
 func unminit() {
-       if getg().m.newSigstack {
-               signalstack(nil)
-       }
+       unminitSignals()
 }
 
 func memlimit() uintptr {
index b16b524ab99b0a7bed4df5db2314e98fb722871b..d6db2518f3546349c806bbcd708fceb0873814fa 100644 (file)
@@ -223,9 +223,7 @@ func minit() {
 // Called from dropm to undo the effect of an minit.
 //go:nosplit
 func unminit() {
-       if getg().m.newSigstack {
-               signalstack(nil)
-       }
+       unminitSignals()
 }
 
 func memlimit() uintptr {
index 3e7c49934b8a8e8ab44b6559af3c89209fdef1a5..3a262452210bb876f24582e068bdc5236694a71c 100644 (file)
@@ -619,6 +619,15 @@ func minitSignalMask() {
        sigprocmask(_SIG_SETMASK, &nmask, nil)
 }
 
+// unminitSignals is called from dropm, via unminit, to undo the
+// effect of calling minit on a non-Go thread.
+//go:nosplit
+func unminitSignals() {
+       if getg().m.newSigstack {
+               signalstack(nil)
+       }
+}
+
 // setGsignalStack sets the gsignal stack of the current m to an
 // alternate signal stack returned from the sigaltstack system call.
 // This is used when handling a signal if non-Go code has set the