runtime, syscall, time: add and use resettimer
Ian Lance Taylor authored
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: default avatarMichael Knyszek <mknyszek@google.com>
Reviewed-by: default avatarEmmanuel Odeke <emm.odeke@gmail.com>
a7ce2ca5
Name Last commit Last update
cgo
debug
internal
msan
pprof
race
testdata
trace
HACKING.md
Makefile
alg.go
asm.s
asm_386.s
asm_amd64.s
asm_arm.s
asm_arm64.s
asm_mips64x.s
asm_mipsx.s
asm_ppc64x.h
asm_ppc64x.s
asm_s390x.s
asm_wasm.s
atomic_arm64.s
atomic_mips64x.s
atomic_mipsx.s
atomic_pointer.go
atomic_ppc64x.s
auxv_none.go
callers_test.go
cgo.go
cgo_mmap.go
cgo_ppc64x.go
cgo_sigaction.go
cgocall.go
cgocallback.go
cgocheck.go
chan.go
chan_test.go
chanbarrier_test.go
checkptr.go
closure_test.go
compiler.go
complex.go
complex_test.go
cpuflags.go
cpuflags_amd64.go
cpuprof.go
cputicks.go
crash_cgo_test.go
crash_nonunix_test.go
crash_test.go
crash_unix_test.go
debug.go
debug_test.go
debugcall.go
debuglog.go
debuglog_off.go
debuglog_on.go
debuglog_test.go
defer_test.go
defs1_linux.go
defs1_netbsd_386.go
defs1_netbsd_amd64.go
defs1_netbsd_arm.go
defs1_netbsd_arm64.go
defs1_solaris_amd64.go
defs2_linux.go
defs3_linux.go
defs_aix.go
defs_aix_ppc64.go
defs_arm_linux.go
defs_darwin.go
defs_darwin_386.go
defs_darwin_amd64.go
defs_darwin_arm.go
defs_darwin_arm64.go
defs_dragonfly.go
defs_dragonfly_amd64.go
defs_freebsd.go
defs_freebsd_386.go
defs_freebsd_amd64.go
defs_freebsd_arm.go
defs_linux.go
defs_linux_386.go
defs_linux_amd64.go
defs_linux_arm.go
defs_linux_arm64.go
defs_linux_mips64x.go
defs_linux_mipsx.go
defs_linux_ppc64.go
defs_linux_ppc64le.go
defs_linux_s390x.go
defs_netbsd.go
defs_netbsd_386.go
defs_netbsd_amd64.go
defs_netbsd_arm.go
defs_openbsd.go
defs_openbsd_386.go
defs_openbsd_amd64.go
defs_openbsd_arm.go
defs_openbsd_arm64.go
defs_plan9_386.go
defs_plan9_amd64.go
defs_plan9_arm.go
defs_solaris.go
defs_solaris_amd64.go
defs_windows.go
defs_windows_386.go