gcc/libstdc++-v3/testsuite/30_threads
Jonathan Wakely cfef4c324a PR libstdc++/80538 Only call sleep for non-zero values
Avoid a system call when no sleep is required. Sleep in a loop (actually
two loops) to handle interruption by signals.

	PR libstdc++/80538
	* src/c++11/thread.cc (this_thread::__sleep_for)
	[_GLIBCXX_HAVE_SLEEP]: Only call sleep for non-zero values.
	Loop while sleep call is interrupted and until steady_clock
	shows requested duration has elapsed.
	(!_GLIBCXX_HAVE_USLEEP]: Use the _GLIBCXX_HAVE_SLEEP code path, but
	avoiding the usleep call.
	* testsuite/30_threads/this_thread/60421.cc: Test repeated
	signal interruptions.

From-SVN: r265044
2018-10-11 17:37:23 +01:00
..
async Remove dg-require-cstdint directive from tests 2018-07-26 15:02:42 +01:00
call_once Remove dg-require-cstdint directive from tests 2018-07-26 15:02:42 +01:00
condition_variable Report early wakeup of condition_variable::wait_until as no_timeout 2018-08-01 16:39:45 +01:00
condition_variable_any * 30_threads/condition_variable_any/cond.cc: New test. 2018-07-26 21:23:12 +00:00
future Remove dg-require-cstdint directive from tests 2018-07-26 15:02:42 +01:00
headers Remove dg-require-cstdint directive from tests 2018-07-26 15:02:42 +01:00
lock Remove dg-require-cstdint directive from tests 2018-07-26 15:02:42 +01:00
lock_guard Remove dg-require-cstdint directive from tests 2018-07-26 15:02:42 +01:00
mutex Remove dg-require-cstdint directive from tests 2018-07-26 15:02:42 +01:00
once_flag/cons Remove dg-require-cstdint directive from tests 2018-07-26 15:02:42 +01:00
packaged_task Remove dg-require-cstdint directive from tests 2018-07-26 15:02:42 +01:00
promise Remove dg-require-cstdint directive from tests 2018-07-26 15:02:42 +01:00
recursive_mutex Remove dg-require-cstdint directive from tests 2018-07-26 15:03:01 +01:00
recursive_timed_mutex Remove dg-require-cstdint directive from tests 2018-07-26 15:03:01 +01:00
scoped_lock Remove dg-require-cstdint directive from tests 2018-07-26 15:03:01 +01:00
shared_future Remove dg-require-cstdint directive from tests 2018-07-26 15:03:01 +01:00
shared_lock Remove dg-require-cstdint directive from tests 2018-07-26 15:03:01 +01:00
shared_mutex Remove dg-require-cstdint directive from tests 2018-07-26 15:03:01 +01:00
shared_timed_mutex Remove dg-require-cstdint directive from tests 2018-07-26 15:03:01 +01:00
this_thread PR libstdc++/80538 Only call sleep for non-zero values 2018-10-11 17:37:23 +01:00
thread Remove dg-require-cstdint directive from tests 2018-07-26 15:03:01 +01:00
timed_mutex Remove dg-require-cstdint directive from tests 2018-07-26 15:03:01 +01:00
try_lock Remove dg-require-cstdint directive from tests 2018-07-26 15:03:01 +01:00
unique_lock Remove dg-require-cstdint directive from tests 2018-07-26 15:03:01 +01:00