Re: [PATCH] PR libstdc++/80538 Only call sleep for non-zero values

2018-10-13 Thread Bernhard Reutner-Fischer
On 13 October 2018 12:56:14 CEST, Jonathan Wakely wrote: >Yes, of course. We don't even look for usleep unless nanosleep isn't >available, so I mean systems with no nanosleep *and* no usleep. Right. Wasn't obvious to me from just the patch. Sorry for the noise..

Re: [PATCH] PR libstdc++/80538 Only call sleep for non-zero values

2018-10-13 Thread Jonathan Wakely
On Sat, 13 Oct 2018 at 08:49, Bernhard Reutner-Fischer wrote: > > On 11 October 2018 23:36:15 CEST, Jonathan Wakely wrote: > > >But I'm assuming that systems with no usleep are probably rare, and > >can live with rounding up to sleep for a full second. > > Well conforming implementations usually

Re: [PATCH] PR libstdc++/80538 Only call sleep for non-zero values

2018-10-13 Thread Bernhard Reutner-Fischer
On 11 October 2018 23:36:15 CEST, Jonathan Wakely wrote: >But I'm assuming that systems with no usleep are probably rare, and >can live with rounding up to sleep for a full second. Well conforming implementations usually won't have usleep which was obscolencent in SUSv3 and removed from SUSv4.

Re: [PATCH] PR libstdc++/80538 Only call sleep for non-zero values

2018-10-11 Thread Jonathan Wakely
On 11/10/18 17:37 +0100, Jonathan Wakely wrote: 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 slee

[PATCH] PR libstdc++/80538 Only call sleep for non-zero values

2018-10-11 Thread Jonathan Wakely
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 c