]> Cypherpunks repositories - gostls13.git/commit
runtime: move per-P timers state into its own struct
authorRuss Cox <rsc@golang.org>
Wed, 14 Feb 2024 16:57:05 +0000 (11:57 -0500)
committerGopher Robot <gobot@golang.org>
Thu, 29 Feb 2024 18:51:47 +0000 (18:51 +0000)
commitadc575e64c8a49c0a14a8a6b0480c5f9815bdb1a
treeffcfd0f85057c6844631632d9e3c6323581aa838
parent8570aaaf1a1f6cf18c146d7f66016b491847f7f7
runtime: move per-P timers state into its own struct

Continuing conversion from C to Go, introduce type timers
encapsulating all timer heap state, with methods for operations.
This should at least be easier to think about, instead of having
these fields strewn through the P struct. It should also be easier
to test.

I am skeptical about the pair of atomic int64 deadlines:
I think there are missed wakeups lurking.
Having the code in an abstracted API should make it easier
to reason through and fix if needed.

[This is one CL in a refactoring stack making very small changes
in each step, so that any subtle bugs that we miss can be more
easily pinpointed to a small change.]

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