Use steady_clock to implement condition_variable::wait_for
authorMike Crowe <mac@mcrowe.com>
Wed, 1 Aug 2018 15:39:57 +0000 (15:39 +0000)
committerJonathan Wakely <redi@gcc.gnu.org>
Wed, 1 Aug 2018 15:39:57 +0000 (16:39 +0100)
commit9e68aa3cc52956ea99bb726c3c29ce0581b9f7e7
tree823a9f37c46670bcc8fb5298f87b86f0029d25d0
parent2f5934326542b3f303db91cc4cd432cd488f0258
Use steady_clock to implement condition_variable::wait_for

The C++ standard says that std::condition_variable::wait_for should be
implemented to be equivalent to:

  return wait_until(lock, chrono::steady_clock::now() + rel_time);

But the existing implementation uses chrono::system_clock. Now that
wait_until has potentially-different behaviour for chrono::steady_clock,
let's at least try to wait using the correct clock.

2018-08-01  Mike Crowe  <mac@mcrowe.com>

* include/std/condition_variable (wait_for): Use steady_clock.

From-SVN: r263225
libstdc++-v3/ChangeLog
libstdc++-v3/include/std/condition_variable