Add and use new glibc-internal futex API.
commita2f0363f817a58c4d3f439aa515a3b1d73efde36
authorTorvald Riegel <triegel@redhat.com>
Thu, 4 Dec 2014 13:12:23 +0000 (4 14:12 +0100)
committerTorvald Riegel <triegel@redhat.com>
Fri, 10 Jul 2015 11:47:09 +0000 (10 13:47 +0200)
tree6204a1208c1421d573e8c91e4523376a18e1dd60
parent203c1a898dd2e281eae30f3c57ceb8d4a50b00f4
Add and use new glibc-internal futex API.

This adds new functions for futex operations, starting with wait,
abstimed_wait, reltimed_wait, wake.  They add documentation and error
checking according to the current draft of the Linux kernel futex manpage.

Waiting with absolute or relative timeouts is split into separate functions.
This allows for removing a few cases of code duplication in pthreads code,
which uses absolute timeouts; also, it allows us to put platform-specific
code to go from an absolute to a relative timeout into the platform-specific
futex abstractions..

Futex operations that can be canceled are also split out into separate
functions suffixed by "_cancelable".

There are separate versions for both Linux and NaCl; while they currently
differ only slightly, my expectation is that the separate versions of
lowlevellock-futex.h will eventually be merged into futex-internal.h
when we get to move the lll_ functions over to the new futex API.
40 files changed:
ChangeLog
nptl/allocatestack.c
nptl/cancellation.c
nptl/nptl-init.c
nptl/pthread_barrier_init.c
nptl/pthread_barrier_wait.c
nptl/pthread_barrierattr_setpshared.c
nptl/pthread_condattr_setpshared.c
nptl/pthread_create.c
nptl/pthread_mutexattr_setpshared.c
nptl/pthread_once.c
nptl/pthread_rwlock_init.c
nptl/pthread_rwlock_rdlock.c
nptl/pthread_rwlock_timedrdlock.c
nptl/pthread_rwlock_timedwrlock.c
nptl/pthread_rwlock_tryrdlock.c
nptl/pthread_rwlock_unlock.c
nptl/pthread_rwlock_wrlock.c
nptl/pthread_rwlockattr_setpshared.c
nptl/sem_init.c
nptl/sem_open.c
nptl/sem_post.c
nptl/sem_wait.c
nptl/sem_waitcommon.c
nptl/unregister-atfork.c
sysdeps/nacl/exit-thread.h
sysdeps/nacl/futex-internal.h [new file with mode: 0644]
sysdeps/nptl/aio_misc.h
sysdeps/nptl/fork.c
sysdeps/nptl/futex-internal.h [new file with mode: 0644]
sysdeps/nptl/gai_misc.h
sysdeps/sparc/nptl/pthread_barrier_init.c
sysdeps/sparc/nptl/pthread_barrier_wait.c
sysdeps/sparc/sparc32/pthread_barrier_wait.c
sysdeps/sparc/sparc32/sem_init.c
sysdeps/sparc/sparc32/sem_open.c
sysdeps/sparc/sparc32/sem_post.c
sysdeps/sparc/sparc32/sem_wait.c
sysdeps/sparc/sparc32/sem_waitcommon.c
sysdeps/unix/sysv/linux/futex-internal.h [new file with mode: 0644]