diff options
| author | Ian Lance Taylor <iant@golang.org> | 2016-09-26 11:14:41 -0700 |
|---|---|---|
| committer | Ian Lance Taylor <iant@golang.org> | 2016-09-26 18:29:32 +0000 |
| commit | ac24388e5e5bdc129451c074a349a982e1d55ffa (patch) | |
| tree | cd5c066aa99c40d3675ce6ea0abe5248e4a3bd29 /src/runtime/os_linux.go | |
| parent | 3390294308462d5ddab95feaf42acc8fde767c98 (diff) | |
| download | go-ac24388e5e5bdc129451c074a349a982e1d55ffa.tar.xz | |
runtime: merge setting new signal mask in minit
All the variants that sets the new signal mask in minit do the same
thing, so merge them. This requires an OS-specific sigdelset function;
the function already exists for linux, and is now added for other OS's.
Change-Id: Ie96f6f02e2cf09c43005085985a078bd9581f670
Reviewed-on: https://go-review.googlesource.com/29771
Run-TryBot: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Diffstat (limited to 'src/runtime/os_linux.go')
| -rw-r--r-- | src/runtime/os_linux.go | 16 |
1 files changed, 2 insertions, 14 deletions
diff --git a/src/runtime/os_linux.go b/src/runtime/os_linux.go index bc0d9f2027..92c3db8616 100644 --- a/src/runtime/os_linux.go +++ b/src/runtime/os_linux.go @@ -257,22 +257,10 @@ func gettid() uint32 // Called to initialize a new m (including the bootstrap m). // Called on the new thread, cannot allocate memory. func minit() { - // Initialize signal handling. - _g_ := getg() - - minitSignalStack() + minitSignals() // for debuggers, in case cgo created the thread - _g_.m.procid = uint64(gettid()) - - // restore signal mask from m.sigmask and unblock essential signals - nmask := _g_.m.sigmask - for i := range sigtable { - if sigtable[i].flags&_SigUnblock != 0 { - sigdelset(&nmask, i) - } - } - sigprocmask(_SIG_SETMASK, &nmask, nil) + getg().m.procid = uint64(gettid()) } // Called from dropm to undo the effect of an minit. |
