[PATCH 2/2] nptl: Add pthread_clockjoin_np
Mike Crowe
mac@mcrowe.com
Tue Jul 16 09:59:00 GMT 2019
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
More information about the Libc-alpha
mailing list