This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH 2/2] nptl: Add pthread_clockjoin_np
- From: Mike Crowe <mac at mcrowe dot com>
- To: Yann Droneaud <ydroneaud at opteya dot com>, libc-alpha at sourceware dot org
- Date: Tue, 16 Jul 2019 10:59:37 +0100
- Subject: Re: [PATCH 2/2] nptl: Add pthread_clockjoin_np
- References: <cover.cef93a65bea8427761cd00d8c3e77989700784b6.1561724011.git-series.mac@mcrowe.com> <b062506121715def972680a512ef8afc661886c9.1561724011.git-series.mac@mcrowe.com> <6058200b07918c508eee5bcf82e2c5ed0d6099ba.camel@opteya.com>
On Friday 28 June 2019 at 15:37:20 +0200, Yann Droneaud wrote:
> Hi,
>
> Le vendredi 28 juin 2019 à 13:13 +0100, Mike Crowe a écrit :
> > Introduce pthread_clockjoin_np as a version of pthread_timedjoin_np that
> > accepts a clockid_t parameter to indicate which clock the timeout should be
> > measured against. This mirrors the recently-added POSIX-proposed "clock"
> > wait functions.
> >
> > * NEWS: Mention addition of pthread_clockjoin_np along with other
> > "clock" variants of existing "timed" functions.
> > * sysdeps/nptl/pthread.h: Add declaration of pthread_clockjoin_np.
> > * manual/threads.texi: Add pthread_clockjoin_np.
> > * nptl/Makefile: Add pthread_clockjoin source file. Add new join
> > tests.
> > * nptl/Versions: Add pthread_clockjoin_np.
> > * nptl/PthreadP.h: Rename __pthread_timedjoin_ex to
> > __pthread_clockjoin_ex and add clockid_t parameter.
> > * nptl/pthread_join_common.c (clockwait_tid): Rename from
> > timedwait_tid and add clockid parameter. Use __clock_gettime
> > passing supplied clockid rather than using __gettimeofday. Perform
> > relative timeout calculation entirely in timespec.
> > (__pthread_clockjoin_ex): Rename from __pthread_timedjoin_ex and
> > add clockid parameter to pass to clockwait_tid rather than
> > timedwait_tid.
> > * nptl/pthread_timedjoin.c (__pthread_timedjoin_np): Call
> > __pthread_clockjoin_ex passing CLOCK_REALTIME as clockid.
> > * nptl/pthread_join.c (__pthread_join): Call __pthread_clockjoin_ex
> > and pass zero as unused clockid_t parameter.
>
> I would prefer -1, just because, on Linux, 0 is CLOCK_REALTIME.
Previously, Adhemerval Zanella had said[1] that they preferred using zero.
Having said that, I appear to have used CLOCK_REALTIME in a few places in
e996fa72a9bad0be72c6d3d99d9faba5efddf44f at least.
Mike.
[1] https://sourceware.org/ml/libc-alpha/2017-06/msg01491.html