Sweden-Number/server
Chip Davis 289d456dd6 ntdll: Fix tick count calculation on Mac.
Inspired by a patch by Andrew Eikum.

macOS's mach_absolute_time() stops counting when the computer goes to
sleep/suspend/hibernate/etc. However, Windows's GetTickCount() does not
stop counting. mach_continuous_time() matches Windows's behavior.

BSD's CLOCK_MONOTONIC already counts asleep time.

Unfortunately, there is no clock source on Linux which does exactly what
we want. CLOCK_MONOTONIC_RAW is unaffected by NTP adjustment, but like
mach_absolute_time() doesn't keep ticking when the computer is asleep.
CLOCK_BOOTTIME does keep ticking, but it is affected by NTP adjustments.
CLOCK_MONOTONIC has both problems. What's needed is a
CLOCK_BOOTTIME_RAW, which would not be slewed by adjtimex(2) and would
count time spent asleep.

To avoid issues with skew and performance, this patch falls back to
mach_absolute_time() on macOS if mach_continuous_time() is unavailable.
Note that mach_continuous_time() was introduced in macOS 10.12, meaning
that if the minimum version required is less than that, it will be
linked weakly. Therefore we must check that it is nonnull before
attempting to call it.

Signed-off-by: Chip Davis <cdavis@codeweavers.com>
Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-11-28 20:45:46 +01:00
..
Makefile.in configure: Link wineserver to libinotify if necessary. 2019-04-22 20:27:30 +02:00
async.c server: A spelling and slight rewording fix in a comment. 2019-08-08 17:53:36 +02:00
atom.c server: Introduce kernel_object struct for generic association between server and kernel objects. 2019-03-26 13:55:15 +01:00
change.c configure: Link wineserver to libinotify if necessary. 2019-04-22 20:27:30 +02:00
class.c server: Release atoms when destroying a window class. 2018-11-28 10:43:37 +01:00
clipboard.c server: Introduce kernel_object struct for generic association between server and kernel objects. 2019-03-26 13:55:15 +01:00
completion.c server: Introduce kernel_object struct for generic association between server and kernel objects. 2019-03-26 13:55:15 +01:00
console.c kernel32: Implement GetCurrentConsoleFontEx. 2019-11-25 20:47:43 +01:00
debugger.c server: Report only one debug event per process at the time. 2019-08-07 00:12:26 +02:00
device.c server: Associate create and close IRPs with current thread. 2019-05-30 21:53:27 +02:00
directory.c server: Introduce kernel_object struct for generic association between server and kernel objects. 2019-03-26 13:55:15 +01:00
event.c ntoskrnl.exe: Support creating event objects from server handle. 2019-03-26 13:59:04 +01:00
fd.c server: Introduce kernel_object struct for generic association between server and kernel objects. 2019-03-26 13:55:15 +01:00
file.c server: Allow creating file kernel objects. 2019-04-23 23:50:45 +02:00
file.h server: Always block overlapped device requests until driver dispatches them. 2019-05-23 22:18:32 +02:00
handle.c server: Introduce kernel_object struct for generic association between server and kernel objects. 2019-03-26 13:55:15 +01:00
handle.h server: Use a common helper function to implement open object calls. 2016-01-29 21:25:12 +09:00
hook.c server: Introduce kernel_object struct for generic association between server and kernel objects. 2019-03-26 13:55:15 +01:00
mach.c server: Add a platform-specific entry point to initialize registers of a new thread. 2017-07-27 17:04:04 +02:00
mailslot.c server: Introduce kernel_object struct for generic association between server and kernel objects. 2019-03-26 13:55:15 +01:00
main.c server: Print the usage to stdout when invoked with --help. 2012-11-23 14:40:07 +01:00
mapping.c server: Fix use after free in add_committed_range (scan-build). 2019-09-12 22:47:45 +02:00
mutex.c server: Introduce kernel_object struct for generic association between server and kernel objects. 2019-03-26 13:55:15 +01:00
named_pipe.c server: Don't block ConnectNamedPipe for pipe in PIPE_NOWAIT mode. 2019-10-16 16:03:36 +02:00
object.c server: Introduce kernel_object struct for generic association between server and kernel objects. 2019-03-26 13:55:15 +01:00
object.h server: Introduce kernel_object struct for generic association between server and kernel objects. 2019-03-26 13:55:15 +01:00
process.c server: Report only one debug event per process at the time. 2019-08-07 00:12:26 +02:00
process.h server: Report only one debug event per process at the time. 2019-08-07 00:12:26 +02:00
procfs.c server: Add a platform-specific entry point to initialize registers of a new thread. 2017-07-27 17:04:04 +02:00
protocol.def ntdll: Implement thread description as information class. 2019-11-26 16:32:32 +01:00
ptrace.c server: Reset hardware breakpoint sizes before setting them. 2018-12-18 17:18:09 +01:00
queue.c server: Validate the filter window handle in get_message. 2019-09-18 21:55:16 +02:00
region.c server: Map region to the window DPI in redraw_region(). 2018-08-24 20:12:05 +02:00
registry.c server: Introduce kernel_object struct for generic association between server and kernel objects. 2019-03-26 13:55:15 +01:00
request.c ntdll: Fix tick count calculation on Mac. 2019-11-28 20:45:46 +01:00
request.h ntdll: Implement thread description as information class. 2019-11-26 16:32:32 +01:00
security.h server: Add default security descriptor ownership for processes. 2019-04-24 21:57:48 +02:00
semaphore.c server: Introduce kernel_object struct for generic association between server and kernel objects. 2019-03-26 13:55:15 +01:00
serial.c server: Introduce kernel_object struct for generic association between server and kernel objects. 2019-03-26 13:55:15 +01:00
signal.c server: Introduce kernel_object struct for generic association between server and kernel objects. 2019-03-26 13:55:15 +01:00
snapshot.c server: Introduce kernel_object struct for generic association between server and kernel objects. 2019-03-26 13:55:15 +01:00
sock.c server: Introduce kernel_object struct for generic association between server and kernel objects. 2019-03-26 13:55:15 +01:00
symlink.c server: Introduce kernel_object struct for generic association between server and kernel objects. 2019-03-26 13:55:15 +01:00
thread.c ntdll: Implement thread description as information class. 2019-11-26 16:32:32 +01:00
thread.h ntdll: Implement thread description as information class. 2019-11-26 16:32:32 +01:00
timer.c server: Introduce kernel_object struct for generic association between server and kernel objects. 2019-03-26 13:55:15 +01:00
token.c server: Create primary group using DOMAIN_GROUP_RID_USERS. 2019-05-01 11:15:29 +02:00
trace.c ntdll: Implement thread description as information class. 2019-11-26 16:32:32 +01:00
unicode.c server: Accept utf-8 data as input in registry files. 2008-01-07 21:17:10 +01:00
unicode.h server: Accept utf-8 data as input in registry files. 2008-01-07 21:17:10 +01:00
user.c server: Free client-side user handles at process exit. 2009-10-15 17:56:04 +02:00
user.h server: Map region to the window DPI in redraw_region(). 2018-08-24 20:12:05 +02:00
window.c server: Use screen coordinates in the update_window_zorder request. 2018-08-27 15:16:45 +02:00
wineserver.de.UTF-8.man.in server: Move WineHQ URLs to https. 2017-12-01 09:23:26 +01:00
wineserver.fr.UTF-8.man.in server: Move WineHQ URLs to https. 2017-12-01 09:23:26 +01:00
wineserver.man.in server: Move WineHQ URLs to https. 2017-12-01 09:23:26 +01:00
winstation.c server: Introduce kernel_object struct for generic association between server and kernel objects. 2019-03-26 13:55:15 +01:00