aboutsummaryrefslogtreecommitdiff
path: root/src/runtime/proc.go
diff options
context:
space:
mode:
Diffstat (limited to 'src/runtime/proc.go')
-rw-r--r--src/runtime/proc.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/runtime/proc.go b/src/runtime/proc.go
index c3144b4dde..a673e45071 100644
--- a/src/runtime/proc.go
+++ b/src/runtime/proc.go
@@ -4474,7 +4474,7 @@ func mcount() int32 {
}
var prof struct {
- signalLock uint32
+ signalLock atomic.Uint32
hz int32
}
@@ -4628,14 +4628,14 @@ func setcpuprofilerate(hz int32) {
// it would deadlock.
setThreadCPUProfiler(0)
- for !atomic.Cas(&prof.signalLock, 0, 1) {
+ for !prof.signalLock.CompareAndSwap(0, 1) {
osyield()
}
if prof.hz != hz {
setProcessCPUProfiler(hz)
prof.hz = hz
}
- atomic.Store(&prof.signalLock, 0)
+ prof.signalLock.Store(0)
lock(&sched.lock)
sched.profilehz = hz