]> Cypherpunks repositories - gostls13.git/commit
time: gracefully handle ts.zombies underflow
authorRuss Cox <rsc@golang.org>
Thu, 7 Mar 2024 18:51:04 +0000 (13:51 -0500)
committerRuss Cox <rsc@golang.org>
Fri, 8 Mar 2024 19:41:32 +0000 (19:41 +0000)
commite38be310a4f725ce9167b3444eedcd3b15a6e683
tree0ae9558754824a1d6bc89d39231cf9d47d89a8d3
parente03e06d5601cf844c6dbd81269ddbea8b55ad7ab
time: gracefully handle ts.zombies underflow

The current implementation sets t.ts before adding t to ts;
that can cause inconsistencies with temporarily negative
ts.zombies values. Handle them gracefully, since we only
care about detecting very positive values.

Pending CL 564977 removes the race that sets t.ts early,
and then CL 569996 builds on top of that to make the count precise.
This CL just gets examples like the new test working sooner.

Change-Id: Ibe1aecc2554f83436f761f48e4050bd962982e4f
Reviewed-on: https://go-review.googlesource.com/c/go/+/569995
Reviewed-by: Austin Clements <austin@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
src/runtime/time.go
src/time/tick_test.go