runtime: use mach_absolute_time for runtime.nanotime
The existing darwin/amd64 implementation of runtime.nanotime returns the wallclock time, which results in timers not functioning properly when system time runs backwards. By implementing the algorithm used by the darwin syscall mach_absolute_time, timers will function as expected. The algorithm is described at https://opensource.apple.com/source/xnu/xnu-3248.60.10/libsyscall/wrappers/mach_absolute_time.s Fixes #17610 Change-Id: I9c8d35240d48249a6837dca1111b1406e2686f67 Reviewed-on: https://go-review.googlesource.com/35292Reviewed-by: Russ Cox <rsc@golang.org> Run-TryBot: Russ Cox <rsc@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
Showing
Please register or sign in to comment