]> Cypherpunks repositories - gostls13.git/commit
runtime: update timers.len with Store instead of Add
authorRuss Cox <rsc@golang.org>
Fri, 16 Feb 2024 23:42:08 +0000 (18:42 -0500)
committerGopher Robot <gobot@golang.org>
Fri, 8 Mar 2024 21:09:39 +0000 (21:09 +0000)
commit3ad5cd4741e438410d57f622e27b69e7e2809042
tree043232f998ac71a354a16f1098918c2c38f42fa4
parent2171e628b8d3d505b0ee82e3ac35a21f12467130
runtime: update timers.len with Store instead of Add

Writes to timers.len are protected by the timers.lock.
There is no need to use an Add instead of a Store,
and the code is clearer (and perhaps slightly faster)
using the Store.

Change-Id: Icc6caef1b7405adec55c9b55b999b71de7d97484
Reviewed-on: https://go-review.googlesource.com/c/go/+/564976
Auto-Submit: Russ Cox <rsc@golang.org>
Reviewed-by: Austin Clements <austin@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
src/runtime/time.go