diff options
Diffstat (limited to 'src/runtime/trace/trace.go')
| -rw-r--r-- | src/runtime/trace/trace.go | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/runtime/trace/trace.go b/src/runtime/trace/trace.go index cf2b6440b2..86c97e2a11 100644 --- a/src/runtime/trace/trace.go +++ b/src/runtime/trace/trace.go @@ -134,7 +134,7 @@ func Start(w io.Writer) error { w.Write(data) } }() - atomic.StoreInt32(&tracing.enabled, 1) + tracing.enabled.Store(true) return nil } @@ -143,12 +143,12 @@ func Start(w io.Writer) error { func Stop() { tracing.Lock() defer tracing.Unlock() - atomic.StoreInt32(&tracing.enabled, 0) + tracing.enabled.Store(false) runtime.StopTrace() } var tracing struct { - sync.Mutex // gate mutators (Start, Stop) - enabled int32 // accessed via atomic + sync.Mutex // gate mutators (Start, Stop) + enabled atomic.Bool } |
