aboutsummaryrefslogtreecommitdiff
path: root/src/pkg/runtime
diff options
context:
space:
mode:
authorDmitriy Vyukov <dvyukov@google.com>2014-08-13 01:02:01 +0400
committerDmitriy Vyukov <dvyukov@google.com>2014-08-13 01:02:01 +0400
commitfe7b29f5fd5be75484ce7ea89c2b63d96f9baa14 (patch)
treec0f1e436d485e306363cee586cfa453475e22ee6 /src/pkg/runtime
parent11016f62d83435c352261fe250ae36660c50c17f (diff)
downloadgo-fe7b29f5fd5be75484ce7ea89c2b63d96f9baa14.tar.xz
runtime/pprof: fix data race
It's unclear why we do this broken double-checked locking. The mutex is not held for the whole duration of CPU profiling. Fixes #8365. LGTM=bradfitz R=golang-codereviews, bradfitz CC=golang-codereviews https://golang.org/cl/116290043
Diffstat (limited to 'src/pkg/runtime')
-rw-r--r--src/pkg/runtime/pprof/pprof.go6
1 files changed, 0 insertions, 6 deletions
diff --git a/src/pkg/runtime/pprof/pprof.go b/src/pkg/runtime/pprof/pprof.go
index 26aa0b8be5..236de54f38 100644
--- a/src/pkg/runtime/pprof/pprof.go
+++ b/src/pkg/runtime/pprof/pprof.go
@@ -574,12 +574,6 @@ func StartCPUProfile(w io.Writer) error {
// each client to specify the frequency, we hard code it.
const hz = 100
- // Avoid queueing behind StopCPUProfile.
- // Could use TryLock instead if we had it.
- if cpu.profiling {
- return fmt.Errorf("cpu profiling already in use")
- }
-
cpu.Lock()
defer cpu.Unlock()
if cpu.done == nil {