summaryrefslogtreecommitdiff
path: root/libgo/go/runtime/signal_unix.go
diff options
context:
space:
mode:
Diffstat (limited to 'libgo/go/runtime/signal_unix.go')
-rw-r--r--libgo/go/runtime/signal_unix.go5
1 files changed, 3 insertions, 2 deletions
diff --git a/libgo/go/runtime/signal_unix.go b/libgo/go/runtime/signal_unix.go
index e85136af7d1..a291d2b6bd4 100644
--- a/libgo/go/runtime/signal_unix.go
+++ b/libgo/go/runtime/signal_unix.go
@@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
+//go:build aix || darwin || dragonfly || freebsd || hurd || linux || netbsd || openbsd || solaris
// +build aix darwin dragonfly freebsd hurd linux netbsd openbsd solaris
package runtime
@@ -288,6 +289,8 @@ func setProcessCPUProfiler(hz int32) {
it.it_value = it.it_interval
setitimer(_ITIMER_PROF, &it, nil)
} else {
+ setitimer(_ITIMER_PROF, &_itimerval{}, nil)
+
// If the Go signal handler should be disabled by default,
// switch back to the signal handler that was installed
// when we enabled profiling. We don't try to handle the case
@@ -311,8 +314,6 @@ func setProcessCPUProfiler(hz int32) {
setsig(_SIGPROF, h)
}
}
-
- setitimer(_ITIMER_PROF, &_itimerval{}, nil)
}
}