]> Cypherpunks repositories - gostls13.git/commit
runtime, syscall, time: add and use resettimer
authorIan Lance Taylor <iant@golang.org>
Thu, 11 Apr 2019 00:23:05 +0000 (17:23 -0700)
committerIan Lance Taylor <iant@golang.org>
Mon, 21 Oct 2019 17:06:22 +0000 (17:06 +0000)
commita7ce2ca52f6de38e7db0a67bbdf697a6b5dc122a
tree2cc39783637634d8d8df9f859e5ead005d68de64
parent7a6da218b191de13f4f3555c55aab958b09b66bd
runtime, syscall, time: add and use resettimer

As a small step toward speeding up timers, restrict modification
of the timer.when field to the timer code itself. Other code that
wants to change the when field of an existing timer must now call
resettimer rather than changing the when field and calling addtimer.
The new resettimer function also works for a new timer.

This is just a refactoring in preparation for later code.

Updates #27707

Change-Id: Iccd5dcad415ffbeac4c2a3cf015e91f82692acf8
Reviewed-on: https://go-review.googlesource.com/c/go/+/171825
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Michael Knyszek <mknyszek@google.com>
Reviewed-by: Emmanuel Odeke <emm.odeke@gmail.com>
src/runtime/mgcscavenge.go
src/runtime/netpoll.go
src/runtime/time.go
src/time/internal_test.go
src/time/sleep.go