[PATCH v2 2/4] manual: Add documentation for pthread_tryjoin_np and pthread_timedjoin_np

Mike Crowe mac@mcrowe.com
Sat Sep 28 08:53:00 GMT 2019


On Thursday 26 September 2019 at 14:26:00 -0700, Adhemerval Zanella wrote:
> On 18/09/2019 05:30, Mike Crowe wrote:
> > This documentation isn't perfect, but it's better than nothing and can
> > hopefully act as a basis for future improvement. In particular, although
> > I'm certain that the functions are MT-Safe, I'm not sure about the rest of
> > the @safety line.
> > 
> > Yann Droneaud pointed out that pthread_timedjoin_np would wait forever if
> > the timeout parameter is passed as NULL. Since it's now too late to change
> > that, I've documented it.
> 
> To which semantic do you think it would be better to change? Since this
> symbol are not yet in POSIX there still the possibility to change it
> by using a new plus a compat symbol.

The alternative would be to mark the timeout parameter as __nonnull and not
permit it to be NULL, as is the case for the other pthread timed*/clock*
functions. I imagine that if the functions were ever standardised then this
would be the case - but that doesn't look like it's on the horizon.

Although we wouldn't break existing binaries if we change the behaviour and
add a compat symbol, we could break people compiling existing source. I
don't think it's a serious enough problem for it to be worth even doing
that.

However, if others feel strongly about it then I'm prepared to make that
change.

Thanks.

Mike.



More information about the Libc-alpha mailing list