diff options
author | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2020-06-07 03:12:36 +0200 |
---|---|---|
committer | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2020-06-07 03:14:49 +0200 |
commit | be22a151f3e2c2e4b9127d4fa30b269f30a7ea2e (patch) | |
tree | 8cac3fb673b78c9fe02a404e142350756ce9742b /sysdeps/htl | |
parent | 6c5ca98d096a5f61144555c76fdfd3c2ad561082 (diff) | |
download | glibc-be22a151f3e2c2e4b9127d4fa30b269f30a7ea2e.zip glibc-be22a151f3e2c2e4b9127d4fa30b269f30a7ea2e.tar.gz glibc-be22a151f3e2c2e4b9127d4fa30b269f30a7ea2e.tar.bz2 |
htl: Add sem_clockwait support
* sysdeps/htl/sem-timedwait.c (__sem_timedwait_internal): Add clock_id
parameter instead of hardcoding CLOCK_REALTIME.
(__sem_clockwait): New function.
(sem_clockwait): New weak alias.
* sysdeps/htl/sem-wait.c (__sem_timedwait_internal): Update declaration.
(__sem_wait): Update call to __sem_timedwait_internal.
* htl/Versions (GLIBC_2.32): Add sem_clockwait.
* sysdeps/mach/hurd/i386/libpthread.abilist (sem_clockwait): Add symbol.
* nptl/Makefile (tests): Move tst-sem5 to...
* sysdeps/pthread/Makefile (tests): ... here.
Diffstat (limited to 'sysdeps/htl')
-rw-r--r-- | sysdeps/htl/sem-timedwait.c | 12 | ||||
-rw-r--r-- | sysdeps/htl/sem-wait.c | 3 |
2 files changed, 12 insertions, 3 deletions
diff --git a/sysdeps/htl/sem-timedwait.c b/sysdeps/htl/sem-timedwait.c index 2d8cf25..0b1b6d0 100644 --- a/sysdeps/htl/sem-timedwait.c +++ b/sysdeps/htl/sem-timedwait.c @@ -25,12 +25,12 @@ int __sem_timedwait_internal (sem_t *restrict sem, + clockid_t clock_id, const struct timespec *restrict timeout) { error_t err; int drain; struct __pthread *self; - clockid_t clock_id = CLOCK_REALTIME; __pthread_spin_wait (&sem->__lock); if (sem->__value > 0) @@ -89,9 +89,17 @@ __sem_timedwait_internal (sem_t *restrict sem, } int +__sem_clockwait (sem_t *sem, clockid_t clockid, + const struct timespec *restrict timeout) +{ + return __sem_timedwait_internal (sem, clockid, timeout); +} +weak_alias (__sem_clockwait, sem_clockwait); + +int __sem_timedwait (sem_t *restrict sem, const struct timespec *restrict timeout) { - return __sem_timedwait_internal (sem, timeout); + return __sem_timedwait_internal (sem, CLOCK_REALTIME, timeout); } weak_alias (__sem_timedwait, sem_timedwait); diff --git a/sysdeps/htl/sem-wait.c b/sysdeps/htl/sem-wait.c index 1db2d90..74b39d5 100644 --- a/sysdeps/htl/sem-wait.c +++ b/sysdeps/htl/sem-wait.c @@ -20,12 +20,13 @@ #include <pt-internal.h> extern int __sem_timedwait_internal (sem_t *restrict sem, + clockid_t clockid, const struct timespec *restrict timeout); int __sem_wait (sem_t *sem) { - return __sem_timedwait_internal (sem, 0); + return __sem_timedwait_internal (sem, CLOCK_REALTIME, 0); } strong_alias (__sem_wait, sem_wait); |