gcc/libstdc++-v3/testsuite/30_threads
Mike Crowe f33a43f9f7 libstdc++: Use correct duration for atomic_futex wait on custom clock [PR 91486]
As Jonathan Wakely pointed out[1], my change in commit
f9ddb696a2 should have been rounding to
the target clock duration type rather than the input clock duration type
in __atomic_futex_unsigned::_M_load_when_equal_until just as (e.g.)
condition_variable does.

As well as fixing this, let's create a rather contrived test that fails
with the previous code, but unfortunately only when run on a machine
with an uptime of over 208.5 days, and even then not always.

[1] https://gcc.gnu.org/pipermail/libstdc++/2020-September/051004.html

libstdc++-v3/ChangeLog:

	PR libstdc++/91486
	* include/bits/atomic_futex.h:
	(__atomic_futex_unsigned::_M_load_when_equal_until): Use target
	clock duration type when rounding.
	* testsuite/30_threads/async/async.cc (test_pr91486_wait_for):
	Rename from test_pr91486.
	(float_steady_clock): New class for test.
	(test_pr91486_wait_until): New test.
2020-10-05 11:32:10 +01:00
..
async libstdc++: Use correct duration for atomic_futex wait on custom clock [PR 91486] 2020-10-05 11:32:10 +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
lock Fix libstdc++ testsuite to handle VxWorks gthreads implementation 2020-08-23 23:18:48 -03:00
lock_guard
mutex Fix libstdc++ testsuite to handle VxWorks gthreads implementation 2020-08-23 23:18:48 -03:00
once_flag/cons
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
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
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