]> Cypherpunks repositories - gostls13.git/commit
runtime: avoid monotonic time zero on systems with low-res timers
authorRuss Cox <rsc@golang.org>
Wed, 25 Oct 2017 15:13:23 +0000 (11:13 -0400)
committerRuss Cox <rsc@golang.org>
Wed, 25 Oct 2017 17:10:20 +0000 (17:10 +0000)
commit986582126a371ff927182ba6e61e364c1341171a
tree59f623208e36d1195424c731ee00660111fb8d3e
parenteb7e84500ffef1f72958a94f135774f6c25b7aad
runtime: avoid monotonic time zero on systems with low-res timers

Otherwise low-res timers cause problems at call sites that expect to
be able to use 0 as meaning "no time set" and therefore expect that
nanotime never returns 0 itself. For example, sched.lastpoll == 0
means no last poll.

Fixes #22394.

Change-Id: Iea28acfddfff6f46bc90f041ec173e0fea591285
Reviewed-on: https://go-review.googlesource.com/73410
Run-TryBot: Russ Cox <rsc@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Austin Clements <austin@google.com>
src/runtime/proc.go
src/runtime/time.go