Commit e2e11f02 authored by Ian Lance Taylor's avatar Ian Lance Taylor

runtime: unify Unix implementations of unminit

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: default avatarBrad Fitzpatrick <bradfitz@golang.org>
parent 6bcd2580
...@@ -214,9 +214,7 @@ func minit() { ...@@ -214,9 +214,7 @@ func minit() {
// Called from dropm to undo the effect of an minit. // Called from dropm to undo the effect of an minit.
func unminit() { func unminit() {
if getg().m.newSigstack { unminitSignals()
signalstack(nil)
}
} }
func memlimit() uintptr { func memlimit() uintptr {
......
...@@ -188,9 +188,7 @@ func minit() { ...@@ -188,9 +188,7 @@ func minit() {
// Called from dropm to undo the effect of an minit. // Called from dropm to undo the effect of an minit.
//go:nosplit //go:nosplit
func unminit() { func unminit() {
if getg().m.newSigstack { unminitSignals()
signalstack(nil)
}
} }
// Mach IPC, to get at semaphores // Mach IPC, to get at semaphores
......
...@@ -190,9 +190,7 @@ func minit() { ...@@ -190,9 +190,7 @@ func minit() {
// Called from dropm to undo the effect of an minit. // Called from dropm to undo the effect of an minit.
//go:nosplit //go:nosplit
func unminit() { func unminit() {
if getg().m.newSigstack { unminitSignals()
signalstack(nil)
}
} }
func memlimit() uintptr { func memlimit() uintptr {
......
...@@ -180,9 +180,7 @@ func minit() { ...@@ -180,9 +180,7 @@ func minit() {
// Called from dropm to undo the effect of an minit. // Called from dropm to undo the effect of an minit.
//go:nosplit //go:nosplit
func unminit() { func unminit() {
if getg().m.newSigstack { unminitSignals()
signalstack(nil)
}
} }
func memlimit() uintptr { func memlimit() uintptr {
......
...@@ -266,9 +266,7 @@ func minit() { ...@@ -266,9 +266,7 @@ func minit() {
// Called from dropm to undo the effect of an minit. // Called from dropm to undo the effect of an minit.
//go:nosplit //go:nosplit
func unminit() { func unminit() {
if getg().m.newSigstack { unminitSignals()
signalstack(nil)
}
} }
func memlimit() uintptr { func memlimit() uintptr {
......
...@@ -244,9 +244,7 @@ func minit() { ...@@ -244,9 +244,7 @@ func minit() {
// Called from dropm to undo the effect of an minit. // Called from dropm to undo the effect of an minit.
//go:nosplit //go:nosplit
func unminit() { func unminit() {
if getg().m.newSigstack { unminitSignals()
signalstack(nil)
}
} }
func memlimit() uintptr { func memlimit() uintptr {
......
...@@ -223,9 +223,7 @@ func minit() { ...@@ -223,9 +223,7 @@ func minit() {
// Called from dropm to undo the effect of an minit. // Called from dropm to undo the effect of an minit.
//go:nosplit //go:nosplit
func unminit() { func unminit() {
if getg().m.newSigstack { unminitSignals()
signalstack(nil)
}
} }
func memlimit() uintptr { func memlimit() uintptr {
......
...@@ -619,6 +619,15 @@ func minitSignalMask() { ...@@ -619,6 +619,15 @@ func minitSignalMask() {
sigprocmask(_SIG_SETMASK, &nmask, nil) 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 // setGsignalStack sets the gsignal stack of the current m to an
// alternate signal stack returned from the sigaltstack system call. // alternate signal stack returned from the sigaltstack system call.
// This is used when handling a signal if non-Go code has set the // This is used when handling a signal if non-Go code has set the
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment