mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
runtime: convert timeHistogram to atomic types
I've dropped the note that sched.timeToRun is protected by sched.lock, as it does not seem to be true. For #53821. Change-Id: I03f8dc6ca0bcd4ccf3ec113010a0aa39c6f7d6ef Reviewed-on: https://go-review.googlesource.com/c/go/+/419449 Reviewed-by: Austin Clements <austin@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Run-TryBot: Michael Pratt <mpratt@google.com>
This commit is contained in:
parent
09cc9bac72
commit
b04e4637db
7 changed files with 11 additions and 29 deletions
|
|
@ -1244,9 +1244,9 @@ func (th *TimeHistogram) Count(bucket, subBucket uint) (uint64, bool) {
|
|||
t := (*timeHistogram)(th)
|
||||
i := bucket*TimeHistNumSubBuckets + subBucket
|
||||
if i >= uint(len(t.counts)) {
|
||||
return t.underflow, false
|
||||
return t.underflow.Load(), false
|
||||
}
|
||||
return t.counts[i], true
|
||||
return t.counts[i].Load(), true
|
||||
}
|
||||
|
||||
func (th *TimeHistogram) Record(duration int64) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue