diff options
author | Albert ARIBAUD (3ADEV) <albert.aribaud@3adev.fr> | 2017-09-08 00:42:10 +0200 |
---|---|---|
committer | Albert ARIBAUD (3ADEV) <albert.aribaud@3adev.fr> | 2018-10-24 12:53:27 +0200 |
commit | edd2c042edae009e62ddf33b76f65a9a4d2ceede (patch) | |
tree | f8bf313f2349fef5c5ec4e821c8383e1e643fb23 /sysdeps/unix/sysv/linux/lowlevellock-futex.h | |
parent | ab06a727ab8176482c472a2956f7458a308b29a8 (diff) | |
download | glibc-edd2c042edae009e62ddf33b76f65a9a4d2ceede.tar glibc-edd2c042edae009e62ddf33b76f65a9a4d2ceede.tar.gz glibc-edd2c042edae009e62ddf33b76f65a9a4d2ceede.tar.bz2 glibc-edd2c042edae009e62ddf33b76f65a9a4d2ceede.zip |
Y2038: add functions using futexes
This creates 64-bit time versions of the following APIs:
- pthread_rwlock_timedrdlock
- pthread_rwlock_timedwrlock
- pthread_mutex_timedlock
- pthread_cond_timedwait
- sem_timedwait
- aio_suspend
It also creates 64-bit time versions of the following
functions or macros:
- lll_timedlock_elision
- lll_timedlock
- __lll_timedlock_wait
- futex_reltimed_wait_cancelable
- lll_futex_timed_wait
- __pthread_cond_wait_common
- futex_abstimed_wait_cancelable
- lll_futex_timed_wait_bitset
- do_aio_misc_wait
- AIO_MISC_WAIT
- __new_sem_wait_slow
- do_futex_wait
- __pthread_rwlock_wrlock_full
- __pthread_rwlock_rdlock_full
- futex_abstimed_wait
Diffstat (limited to 'sysdeps/unix/sysv/linux/lowlevellock-futex.h')
-rw-r--r-- | sysdeps/unix/sysv/linux/lowlevellock-futex.h | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/sysdeps/unix/sysv/linux/lowlevellock-futex.h b/sysdeps/unix/sysv/linux/lowlevellock-futex.h index fc834ed16e..02fc2a51cd 100644 --- a/sysdeps/unix/sysv/linux/lowlevellock-futex.h +++ b/sysdeps/unix/sysv/linux/lowlevellock-futex.h @@ -82,6 +82,16 @@ __lll_private_flag (FUTEX_WAIT, private), \ val, timeout) +#define lll_futex_timed_wait64(futexp, val, timeout, private) \ + ({ \ + struct timespec ts; \ + ts.tv_sec = timeout->tv_sec; \ + ts.tv_nsec = timeout->tv_nsec; \ + lll_futex_syscall (4, futexp, \ + __lll_private_flag (FUTEX_WAIT, private), \ + val, &ts); \ + }) + #define lll_futex_timed_wait_bitset(futexp, val, timeout, clockbit, private) \ lll_futex_syscall (6, futexp, \ __lll_private_flag (FUTEX_WAIT_BITSET | (clockbit), \ @@ -89,6 +99,18 @@ val, timeout, NULL /* Unused. */, \ FUTEX_BITSET_MATCH_ANY) +#define lll_futex_timed_wait_bitset64(futexp, val, timeout, clockbit, private) \ + ({ \ + struct timespec ts; \ + ts.tv_sec = timeout->tv_sec; \ + ts.tv_nsec = timeout->tv_nsec; \ + lll_futex_syscall (6, futexp, \ + __lll_private_flag (FUTEX_WAIT_BITSET | (clockbit), \ + private), \ + val, &ts, NULL /* Unused. */, \ + FUTEX_BITSET_MATCH_ANY); \ + }) + #define lll_futex_wake(futexp, nr, private) \ lll_futex_syscall (4, futexp, \ __lll_private_flag (FUTEX_WAKE, private), nr, 0) |