This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH v4 05/12] nptl: Add POSIX-proposed sem_clockwait
On Friday 21 June 2019 at 13:02:42 -0300, Adhemerval Zanella wrote:
>
>
> On 18/06/2019 13:33, Mike Crowe wrote:
> > Add:
> >
> > int sem_clockwait (sem_t *sem, clockid_t clock, const struct timespec *abstime)
> >
> > which behaves just like sem_timedwait, but measures abstime against the
> > specified clock. Currently supports CLOCK_REALTIME and CLOCK_MONOTONIC and
> > sets errno == EINVAL if any other clock is specified.
> >
> > * nptl/sem_waitcommon.c (do_futex_wait, __new_sem_wait_slow): Add clockid
> > parameters to indicate the clock which abstime should be measured
> > against.
> >
> > * nptl/sem_timedwait.c (sem_timedwait), nptl/sem_wait.c (__new_sem_wait):
> > Pass CLOCK_REALTIME as clockid to __new_sem_wait_slow.
> >
> > * nptl/sem_clockwait.c: New file to implement sem_clockwait based on
> > sem_timedwait.c.
> >
> > * nptl/Makefile: Add sem_clockwait.c source file. Add CFLAGS for
> > sem_clockwait.c to match those used for sem_timedwait.c.
> >
> > * sysdeps/pthread/semaphore.h: Add sem_clockwait.
> >
> > * nptl/Versions (GLIBC_2.30): Likewise.
> >
> > * sysdeps/unix/sysv/linux/aarch64/libpthread.abilist (GLIBC_2.30): Likewise.
> > * sysdeps/unix/sysv/linux/alpha/libpthread.abilist (GLIBC_2.30): Likewise.
> > * sysdeps/unix/sysv/linux/arm/libpthread.abilist (GLIBC_2.30): Likewise.
> > * sysdeps/unix/sysv/linux/csky/libpthread.abilist (GLIBC_2.30): Likewise.
> > * sysdeps/unix/sysv/linux/hppa/libpthread.abilist (GLIBC_2.30): Likewise.
> > * sysdeps/unix/sysv/linux/i386/libpthread.abilist (GLIBC_2.30): Likewise.
> > * sysdeps/unix/sysv/linux/ia64/libpthread.abilist (GLIBC_2.30): Likewise.
> > * sysdeps/unix/sysv/linux/m68k/coldfire/libpthread.abilist (GLIBC_2.30):
> > Likewise.
> > * sysdeps/unix/sysv/linux/m68k/m680x0/libpthread.abilist (GLIBC_2.30):
> > Likewise.
> > * sysdeps/unix/sysv/linux/microblaze/libpthread.abilist (GLIBC_2.30):
> > Likewise.
> > * sysdeps/unix/sysv/linux/mips/mips32/libpthread.abilist (GLIBC_2.30):
> > Likewise.
> > * sysdeps/unix/sysv/linux/mips/mips64/libpthread.abilist (GLIBC_2.30):
> > Likewise.
> > * sysdeps/unix/sysv/linux/nios2/libpthread.abilist (GLIBC_2.30): Likewise.
> > * sysdeps/unix/sysv/linux/powerpc/powerpc32/libpthread.abilist
> > (GLIBC_2.30): Likewise.
> > * sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libpthread.abilist
> > (GLIBC_2.30): Likewise.
> > * sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libpthread.abilist
> > (GLIBC_2.30): Likewise.
> > * sysdeps/unix/sysv/linux/riscv/rv64/libpthread.abilist (GLIBC_2.30):
> > Likewise.
> > * sysdeps/unix/sysv/linux/s390/s390-32/libpthread.abilist (GLIBC_2.30):
> > Likewise.
> > * sysdeps/unix/sysv/linux/s390/s390-64/libpthread.abilist (GLIBC_2.30):
> > Likewise.
> > * sysdeps/unix/sysv/linux/sh/libpthread.abilist (GLIBC_2.30): Likewise.
> > * sysdeps/unix/sysv/linux/sparc/sparc32/libpthread.abilist (GLIBC_2.30):
> > Likewise.
> > * sysdeps/unix/sysv/linux/sparc/sparc64/libpthread.abilist (GLIBC_2.30):
> > Likewise.
> > * sysdeps/unix/sysv/linux/x86_64/64/libpthread.abilist (GLIBC_2.30):
> > Likewise.
> > * sysdeps/unix/sysv/linux/x86_64/x32/libpthread.abilist (GLIBC_2.30):
> > Likewise.
> >
> > * nptl/tst-sem17.c: Add new test for passing invalid clock to
> > sem_clockwait.
> >
> > * nptl/tst-sem13.c, nptl/tst-sem5.c: Modify existing sem_timedwait tests to
> > also test sem_clockwait.
> >
> > * manual/threads.texi: Document sem_clockwait.
>
> LGTM with just one nit below regarding alpha abilist (I will fix it prior
> push).
Thanks. I must have done alpha by hand a long time ago. I still need to
investigate the automated way to add these that you mentioned recently.
> The change seems to align with proposed Android addition [1].
>
> [1] https://android-review.googlesource.com/c/platform/bionic/+/958058
Yes. I've been coordinating with Tom. He's very keen to get these new
functions in too.
Mike.