llvm-project/libcxx
Louis Dionne 8bec892713 [libc++][Apple] Use CLOCK_MONOTONIC_RAW instead of CLOCK_UPTIME_RAW for steady_clock
Summary:
In D27429, we switched the Apple implementation of steady_clock::now()
from clock_gettime(CLOCK_MONOTONIC) to clock_gettime(CLOCK_UPTIME_RAW).
The purpose was to get nanosecond precision, and also to improve the
performance of the implementation.

However, it appears that CLOCK_UPTIME_RAW does not satisfy the requirements
of the Standard, since it is not strictly speaking monotonic. Indeed, the
clock does not increment while the system is asleep, which had been
mentioned in D27429 but somehow not addressed.

This patch switches to CLOCK_MONOTONIC_RAW, which is monotonic, increased
during sleep, and also has nanosecond precision.

https://llvm.org/PR44773

Reviewers: bruno, howard.hinnant, EricWF

Subscribers: christof, jkorous, dexonsmith, libcxx-commits, mclow.lists, EricWF

Tags: #libc

Differential Revision: https://reviews.llvm.org/D74341
2020-02-12 16:43:36 +01:00
..
benchmarks [libc++] Add additional benchmark functions to libcxx/benchmarks/string.bench 2020-01-07 16:31:40 -05:00
cmake [libc++] Explicitly specify LIBCXX_ENABLE_SHARED to try and fix CI 2020-01-29 17:29:43 -08:00
docs Reland [libc++] [P0325] Implement to_array from LFTS with updates. 2020-01-31 11:47:18 +01:00
fuzzing [libc++] Tolerate NaN returning random distributions for now 2019-12-12 17:11:13 -05:00
include [libc++] span: Guard against overflow in span::subspan 2020-02-12 16:21:46 +01:00
lib [libc++] Add missing revision number in ABI changelog 2019-10-03 16:50:05 +00:00
src [libc++][Apple] Use CLOCK_MONOTONIC_RAW instead of CLOCK_UPTIME_RAW for steady_clock 2020-02-12 16:43:36 +01:00
test [libc++] span: Guard against overflow in span::subspan 2020-02-12 16:21:46 +01:00
utils [libc++][macOS CI] Ensure that the SDK version is not older than the deployment target 2020-02-11 13:52:41 +01:00
www Reland [libc++] [P0325] Implement to_array from LFTS with updates. 2020-01-31 11:47:18 +01:00
.arcconfig [libcxx] Set up .arcconfig to point to new Diffusion CXX repository 2017-12-04 17:55:28 +00:00
.clang-format
.gitignore
CMakeLists.txt [CMake][libcxx] Don't wrap __config_site path in quotes on Windows 2020-01-29 19:37:35 -08:00
CREDITS.TXT [libcxx] Add Sergej Jaskiewicz to CREDITS.txt 2019-11-21 12:06:10 +03:00
LICENSE.TXT Fix typos throughout the license files that somehow I and my reviewers 2019-01-21 09:52:34 +00:00
NOTES.TXT Reland "Use custom command and target to install libc++ headers" 2018-06-12 03:10:02 +00:00
TODO.TXT
appveyor-reqs-install.cmd Attempt to upgrade compiler used by appveyor builds 2019-04-03 20:40:01 +00:00
appveyor.yml disable appveyor config for MSVC 2015 2019-04-03 20:36:51 +00:00