gcc/libstdc++-v3/testsuite/30_threads/this_thread
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
..
1.cc Remove dg-require-cstdint directive from tests 2018-07-26 15:03:01 +01:00
2.cc Remove dg-require-cstdint directive from tests 2018-07-26 15:03:01 +01:00
3.cc Remove dg-require-cstdint directive from tests 2018-07-26 15:03:01 +01:00
4.cc Remove dg-require-cstdint directive from tests 2018-07-26 15:03:01 +01:00
57060.cc Update copyright years. 2018-01-03 11:03:58 +01:00
58038.cc Remove dg-require-cstdint directive from tests 2018-07-26 15:03:01 +01:00
60421.cc PR libstdc++/80538 Only call sleep for non-zero values 2018-10-11 17:37:23 +01:00