On Wednesday 01 August 2018 at 20:38:33 +0100, Jonathan Wakely wrote:
> On 01/08/18 14:19 +0100, Mike Crowe wrote:
> > I believe that I've added this functionality in a way that it doesn't break
> > ABI compatibility, but that has made it more verbose and less type safe. I
> > believe that it would be better to maintain the timeout as an instance of
> > the correct clock type all the way down to a single _M_futex_wait_until
> > function with an overload for each clock. The current scheme of separating
> > out the seconds and nanoseconds early risks accidentally calling the wait
> > function for the wrong clock.
> 
> Surely that would just be a programming error?

Yes, but it's not one that the compiler can detect.

> Users aren't calling
> these functions, and we only call them in a very limited number of
> places, so the risk of calling the wrong one seems manageable. Just
> don't do that.

I see no reason not to use the type system to help avoid mistakes in the
internal impementation of the library as well as in its external interface.
But, as you say, the function is only called from a few places so there's
little reason to change it now.

> > diff --git a/libstdc++-v3/src/c++11/futex.cc 
> > b/libstdc++-v3/src/c++11/futex.cc
[snip]
> > +       // We only get to here if futex_clock_realtime_unavailable was
> 
> This should say futex_clock_monotonic_unavailable.

Thanks. I've fixed that, but I'm not sure whether you want me to continue
to updating these patches or whether you plan to apply all the fixes
yourself before committing them.

Thanks.

Mike.

Reply via email to