diff options
author | Mike Crowe <mac@mcrowe.com> | 2020-09-11 14:25:00 +0100 |
---|---|---|
committer | Jonathan Wakely <jwakely@redhat.com> | 2020-09-11 14:28:24 +0100 |
commit | 87fce1923fcc8d6ef508500475c149082dc9d338 (patch) | |
tree | be8cbd9b44ee5bf688a63c6a5a1895922abbc62f /gcc/tree-ssa-sink.c | |
parent | 01d412ef36f56c6961858f4d3d395d000e3f1c06 (diff) | |
download | gcc-87fce1923fcc8d6ef508500475c149082dc9d338.zip gcc-87fce1923fcc8d6ef508500475c149082dc9d338.tar.gz gcc-87fce1923fcc8d6ef508500475c149082dc9d338.tar.bz2 |
libstdc++: Use std::chrono::steady_clock as atomic_futex reference clock
The user-visible effect of this change is that std::future::wait_for now
uses std::chrono::steady_clock to determine the timeout. This makes it
immune to changes made to the system clock. It also means that anyone
using their own clock types with std::future::wait_until will have the
timeout converted to std::chrono::steady_clock rather than
std::chrono::system_clock.
Now that use of both std::chrono::steady_clock and
std::chrono::system_clock are correctly supported for the wait timeout, I
believe that std::chrono::steady_clock is a better choice for the reference
clock that all other clocks are converted to since it is guaranteed to
advance steadily. The previous behaviour of converting to
std::chrono::system_clock risks timeouts changing dramatically when the
system clock is changed.
libstdc++-v3/ChangeLog:
* include/bits/atomic_futex.h (__atomic_futex_unsigned): Change
__clock_t typedef to use steady_clock so that unknown clocks are
synced to it rather than system_clock. Change existing __clock_t
overloads of _M_load_and_text_until_impl and
_M_load_when_equal_until to use system_clock explicitly. Remove
comment about DR 887 since these changes address that problem as
best as we currently able.
Diffstat (limited to 'gcc/tree-ssa-sink.c')
0 files changed, 0 insertions, 0 deletions