]> Cypherpunks repositories - gostls13.git/commit
runtime: make time correctly update on Wine
authorEvgeniy Polyakov <zbr@ioremap.net>
Thu, 20 Apr 2017 13:51:36 +0000 (16:51 +0300)
committerAlex Brainman <alex.brainman@gmail.com>
Tue, 25 Apr 2017 04:30:06 +0000 (04:30 +0000)
commit9f98e49825e38267dc5e91b827cb1db3291ff3bb
treee87b8929e6c25693bf5fe0bb6cbdd08b2cfb0e6d
parentb0472e225bddf7c7ba2b61f10339106719f25b7f
runtime: make time correctly update on Wine

Implemented low-level time system for windows on hardware (software),
which does not support memory mapped _KSYSTEM_TIME page update.

In particular this problem exists on Wine where _KSYSTEM_TIME
only contains time at the start, and is never modified.

On start we try to detect Wine and if it's so we fallback to
GetSystemTimeAsFileTime() for current time and a monotonic
timer based on QueryPerformanceCounter family of syscalls:
https://msdn.microsoft.com/en-us/library/windows/desktop/dn553408(v=vs.85).aspx

Fixes #18537

Change-Id: I269d22467ed9b0afb62056974d23e731b80c83ed
Reviewed-on: https://go-review.googlesource.com/35710
Reviewed-by: Alex Brainman <alex.brainman@gmail.com>
Run-TryBot: Alex Brainman <alex.brainman@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
src/runtime/os_windows.go
src/runtime/sys_windows_386.s
src/runtime/sys_windows_amd64.s