]> Cypherpunks repositories - gostls13.git/commit
runtime: use monotonic clock for timers (linux/386, linux/amd64)
authorJay Weisskopf <jay@jayschwa.net>
Mon, 24 Feb 2014 15:57:46 +0000 (10:57 -0500)
committerRuss Cox <rsc@golang.org>
Mon, 24 Feb 2014 15:57:46 +0000 (10:57 -0500)
commit86c976ffd094c0326c9ba2e3d47d9cc6d73084cf
tree9ba9e40ed56c7c732a365173bf42014bd20d8a13
parent7403071ada618d2db82b7897cce19cd1627c8831
runtime: use monotonic clock for timers (linux/386, linux/amd64)

This lays the groundwork for making Go robust when the system's
calendar time jumps around. All input values to the runtimeTimer
struct now use the runtime clock as a common reference point.
This affects net.Conn.Set[Read|Write]Deadline(), time.Sleep(),
time.Timer, etc. Under normal conditions, behavior is unchanged.

Each platform and architecture's implementation of runtime·nanotime()
should be modified to use a monotonic system clock when possible.

Platforms/architectures modified and tested with monotonic clock:
  linux/x86     - clock_gettime(CLOCK_MONOTONIC)

Update #6007

LGTM=dvyukov, rsc
R=golang-codereviews, dvyukov, alex.brainman, stephen.gutekanst, dave, rsc, mikioh.mikioh
CC=golang-codereviews
https://golang.org/cl/53010043
src/pkg/net/fd_poll_runtime.go
src/pkg/runtime/netpoll.goc
src/pkg/runtime/sys_linux_386.s
src/pkg/runtime/sys_linux_amd64.s
src/pkg/runtime/time.goc
src/pkg/time/internal_test.go
src/pkg/time/sleep.go
src/pkg/time/tick.go