gcc/libstdc++-v3/testsuite/30_threads
Mike Crowe e05ff30078 libstdc++: Avoid rounding errors on custom clocks in condition_variable
The fix for PR68519 in 83fd5e73b3 only
applied to condition_variable::wait_for. This problem can also apply to
condition_variable::wait_until but only if the custom clock is using a
more recent epoch so that a small enough delta can be calculated. let's
use the newly-added chrono::__detail::ceil to fix this and also make use
of that function to simplify the previous wait_for fixes.

Also, simplify the existing test case for PR68519 a little and make its
variables local so we can add a new test case for the above problem.
Unfortunately, the test would have only started failing if sufficient
time has passed since the chrono::steady_clock epoch had passed anyway,
but it's better than nothing.

libstdc++-v3/ChangeLog:

	* include/std/condition_variable (condition_variable::wait_until):
	Convert delta to steady_clock duration before adding to current
	steady_clock time to avoid rounding errors described in PR68519.
	(condition_variable::wait_for): Simplify calculation of absolute
	time by using chrono::__detail::ceil in both overloads.
	* testsuite/30_threads/condition_variable/members/68519.cc:
	(test_wait_for): Renamed from test01. Replace unassigned val
	variable with constant false. Reduce scope of mx and cv
	variables to just test_wait_for function.
	(test_wait_until): Add new test case.
2020-09-11 14:28:50 +01:00
..
async libstdc++: Avoid rounding errors in std::future::wait_* [PR 91486] 2020-09-11 14:28:50 +01:00
call_once Fix libstdc++ testsuite to handle VxWorks gthreads implementation 2020-08-23 23:18:48 -03:00
condition_variable libstdc++: Avoid rounding errors on custom clocks in condition_variable 2020-09-11 14:28:50 +01:00
condition_variable_any Fix libstdc++ testsuite to handle VxWorks gthreads implementation 2020-08-23 23:18:48 -03:00
future libstdc++: Adjust static assertions in futures and promises [LWG 3466] 2020-08-25 15:52:57 +01:00
headers libstdc++: Use c++NN_only effective target to tests 2020-07-31 19:58:02 +01:00
jthread libstdc++: Update value of __cpp_lib_jthread macro 2020-04-22 22:54:34 +01:00
lock Fix libstdc++ testsuite to handle VxWorks gthreads implementation 2020-08-23 23:18:48 -03:00
lock_guard Update copyright years. 2020-01-01 12:51:42 +01:00
mutex Fix libstdc++ testsuite to handle VxWorks gthreads implementation 2020-08-23 23:18:48 -03:00
once_flag/cons Update copyright years. 2020-01-01 12:51:42 +01:00
packaged_task libstdc++: Fix 30_threads/packaged_task/cons/alloc.cc regression 2020-08-24 16:07:12 +01:00
promise libstdc++: Adjust static assertions in futures and promises [LWG 3466] 2020-08-25 15:52:57 +01:00
recursive_mutex Fix libstdc++ testsuite to handle VxWorks gthreads implementation 2020-08-23 23:18:48 -03:00
recursive_timed_mutex Fix libstdc++ testsuite to handle VxWorks gthreads implementation 2020-08-23 23:18:48 -03:00
scoped_lock Update copyright years. 2020-01-01 12:51:42 +01:00
shared_future libstdc++: Adjust static assertions in futures and promises [LWG 3466] 2020-08-25 15:52:57 +01:00
shared_lock Fix libstdc++ testsuite to handle VxWorks gthreads implementation 2020-08-23 23:18:48 -03:00
shared_mutex Fix libstdc++ testsuite to handle VxWorks gthreads implementation 2020-08-23 23:18:48 -03:00
shared_timed_mutex Fix libstdc++ testsuite to handle VxWorks gthreads implementation 2020-08-23 23:18:48 -03:00
stop_token libstdc++: Update value of __cpp_lib_jthread macro 2020-04-22 22:54:34 +01:00
this_thread Fix libstdc++ testsuite to handle VxWorks gthreads implementation 2020-08-23 23:18:48 -03:00
thread Fix libstdc++ testsuite to handle VxWorks gthreads implementation 2020-08-23 23:18:48 -03:00
timed_mutex Fix libstdc++ testsuite to handle VxWorks gthreads implementation 2020-08-23 23:18:48 -03:00
try_lock Fix libstdc++ testsuite to handle VxWorks gthreads implementation 2020-08-23 23:18:48 -03:00
unique_lock Fix libstdc++ testsuite to handle VxWorks gthreads implementation 2020-08-23 23:18:48 -03:00