diff options
| author | gfleury <gfleury@disroot.org> | 2025-02-16 16:54:31 +0200 |
|---|---|---|
| committer | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2025-02-16 23:08:54 +0100 |
| commit | 25650ef6b9606dcfe3112d4a662ae44f55f5568c (patch) | |
| tree | 5095c00cb55e8d1e24d3b96e5c39910f107de342 /sysdeps/htl | |
| parent | 119798a7b1670065c9ccdc3e49440f1034961524 (diff) | |
| download | glibc-25650ef6b9606dcfe3112d4a662ae44f55f5568c.tar.xz glibc-25650ef6b9606dcfe3112d4a662ae44f55f5568c.zip | |
htl: move pthread_rwlock_{rdlock, timedrdlock, timedwrlock, wrlock, clockrdlock, clockwrlock} into libc.
Signed-off-by: gfleury <gfleury@disroot.org>
Message-ID: <20250216145434.7089-8-gfleury@disroot.org>
Diffstat (limited to 'sysdeps/htl')
| -rw-r--r-- | sysdeps/htl/libc-lockP.h | 6 | ||||
| -rw-r--r-- | sysdeps/htl/pt-rwlock-rdlock.c | 8 | ||||
| -rw-r--r-- | sysdeps/htl/pt-rwlock-timedrdlock.c | 16 | ||||
| -rw-r--r-- | sysdeps/htl/pt-rwlock-timedwrlock.c | 16 | ||||
| -rw-r--r-- | sysdeps/htl/pt-rwlock-wrlock.c | 9 | ||||
| -rw-r--r-- | sysdeps/htl/pthread-functions.h | 4 | ||||
| -rw-r--r-- | sysdeps/htl/pthreadP.h | 12 |
7 files changed, 54 insertions, 17 deletions
diff --git a/sysdeps/htl/libc-lockP.h b/sysdeps/htl/libc-lockP.h index 7e9bdd1c4b..ae2e4668bb 100644 --- a/sysdeps/htl/libc-lockP.h +++ b/sysdeps/htl/libc-lockP.h @@ -96,11 +96,13 @@ extern int __pthread_rwlock_init (pthread_rwlock_t *__rwlock, extern int __pthread_rwlock_destroy (pthread_rwlock_t *__rwlock); extern int __pthread_rwlock_rdlock (pthread_rwlock_t *__rwlock); +libc_hidden_proto (__pthread_rwlock_rdlock) extern int __pthread_rwlock_tryrdlock (pthread_rwlock_t *__rwlock); libc_hidden_proto (__pthread_rwlock_tryrdlock) extern int __pthread_rwlock_wrlock (pthread_rwlock_t *__rwlock); +libc_hidden_proto (__pthread_rwlock_wrlock) extern int __pthread_rwlock_trywrlock (pthread_rwlock_t *__rwlock); libc_hidden_proto (__pthread_rwlock_trywrlock) @@ -123,8 +125,6 @@ libc_hidden_proto (__pthread_setcancelstate) # ifdef weak_extern weak_extern (__pthread_rwlock_init) weak_extern (__pthread_rwlock_destroy) -weak_extern (__pthread_rwlock_rdlock) -weak_extern (__pthread_rwlock_wrlock) weak_extern (__pthread_key_create) weak_extern (__pthread_setspecific) weak_extern (__pthread_getspecific) @@ -133,8 +133,6 @@ weak_extern (__pthread_initialize) weak_extern (__pthread_atfork) # else # pragma weak __pthread_rwlock_destroy -# pragma weak __pthread_rwlock_rdlock -# pragma weak __pthread_rwlock_wrlock # pragma weak __pthread_key_create # pragma weak __pthread_setspecific # pragma weak __pthread_getspecific diff --git a/sysdeps/htl/pt-rwlock-rdlock.c b/sysdeps/htl/pt-rwlock-rdlock.c index a2f6e47b5c..15648a8459 100644 --- a/sysdeps/htl/pt-rwlock-rdlock.c +++ b/sysdeps/htl/pt-rwlock-rdlock.c @@ -18,6 +18,7 @@ #include <pthread.h> #include <pt-internal.h> +#include <shlib-compat.h> /* Implemented in pt-rwlock-timedrdlock.c. */ extern int __pthread_rwlock_timedrdlock_internal (struct __pthread_rwlock @@ -32,4 +33,9 @@ __pthread_rwlock_rdlock (struct __pthread_rwlock *rwlock) { return __pthread_rwlock_timedrdlock_internal (rwlock, -1, 0); } -weak_alias (__pthread_rwlock_rdlock, pthread_rwlock_rdlock); +libc_hidden_def (__pthread_rwlock_rdlock) +versioned_symbol (libc, __pthread_rwlock_rdlock, pthread_rwlock_rdlock, GLIBC_2_42); + +#if OTHER_SHLIB_COMPAT (libpthread, GLIBC_2_12, GLIBC_2_42) +compat_symbol (libpthread, __pthread_rwlock_rdlock, pthread_rwlock_rdlock, GLIBC_2_12); +#endif diff --git a/sysdeps/htl/pt-rwlock-timedrdlock.c b/sysdeps/htl/pt-rwlock-timedrdlock.c index 3c900e6636..93874a1698 100644 --- a/sysdeps/htl/pt-rwlock-timedrdlock.c +++ b/sysdeps/htl/pt-rwlock-timedrdlock.c @@ -19,8 +19,8 @@ #include <pthread.h> #include <assert.h> #include <time.h> - #include <pt-internal.h> +#include <shlib-compat.h> /* Acquire the rwlock *RWLOCK for reading blocking until *ABSTIME if it is already held. As a GNU extension, if TIMESPEC is NULL then @@ -122,7 +122,12 @@ __pthread_rwlock_timedrdlock (struct __pthread_rwlock *rwlock, { return __pthread_rwlock_timedrdlock_internal (rwlock, CLOCK_REALTIME, abstime); } -weak_alias (__pthread_rwlock_timedrdlock, pthread_rwlock_timedrdlock) +libc_hidden_def (__pthread_rwlock_timedrdlock) +versioned_symbol (libc, __pthread_rwlock_timedrdlock, pthread_rwlock_timedrdlock, GLIBC_2_42); + +#if OTHER_SHLIB_COMPAT (libpthread, GLIBC_2_12, GLIBC_2_42) +compat_symbol (libpthread, __pthread_rwlock_timedrdlock, pthread_rwlock_timedrdlock, GLIBC_2_12); +#endif int __pthread_rwlock_clockrdlock (struct __pthread_rwlock *rwlock, @@ -131,4 +136,9 @@ __pthread_rwlock_clockrdlock (struct __pthread_rwlock *rwlock, { return __pthread_rwlock_timedrdlock_internal (rwlock, clockid, abstime); } -weak_alias (__pthread_rwlock_clockrdlock, pthread_rwlock_clockrdlock) +libc_hidden_def (__pthread_rwlock_clockrdlock) +versioned_symbol (libc, __pthread_rwlock_clockrdlock, pthread_rwlock_clockrdlock, GLIBC_2_42); + +#if OTHER_SHLIB_COMPAT (libpthread, GLIBC_2_32, GLIBC_2_42) +compat_symbol (libpthread, __pthread_rwlock_clockrdlock, pthread_rwlock_clockrdlock, GLIBC_2_32); +#endif diff --git a/sysdeps/htl/pt-rwlock-timedwrlock.c b/sysdeps/htl/pt-rwlock-timedwrlock.c index 3780119d71..bf3cc55ef6 100644 --- a/sysdeps/htl/pt-rwlock-timedwrlock.c +++ b/sysdeps/htl/pt-rwlock-timedwrlock.c @@ -19,8 +19,8 @@ #include <pthread.h> #include <assert.h> #include <time.h> - #include <pt-internal.h> +#include <shlib-compat.h> /* Acquire RWLOCK for writing blocking until *ABSTIME if we cannot get it. As a special GNU extension, if ABSTIME is NULL then the wait @@ -105,7 +105,12 @@ __pthread_rwlock_timedwrlock (struct __pthread_rwlock *rwlock, { return __pthread_rwlock_timedwrlock_internal (rwlock, CLOCK_REALTIME, abstime); } -weak_alias (__pthread_rwlock_timedwrlock, pthread_rwlock_timedwrlock) +libc_hidden_def (__pthread_rwlock_timedwrlock) +versioned_symbol (libc, __pthread_rwlock_timedwrlock, pthread_rwlock_timedwrlock, GLIBC_2_42); + +#if OTHER_SHLIB_COMPAT (libpthread, GLIBC_2_12, GLIBC_2_42) +compat_symbol (libpthread, __pthread_rwlock_timedwrlock, pthread_rwlock_timedwrlock, GLIBC_2_12); +#endif int __pthread_rwlock_clockwrlock (struct __pthread_rwlock *rwlock, @@ -114,4 +119,9 @@ __pthread_rwlock_clockwrlock (struct __pthread_rwlock *rwlock, { return __pthread_rwlock_timedwrlock_internal (rwlock, clockid, abstime); } -weak_alias (__pthread_rwlock_clockwrlock, pthread_rwlock_clockwrlock) +libc_hidden_def (__pthread_rwlock_clockwrlock) +versioned_symbol (libc, __pthread_rwlock_clockwrlock, pthread_rwlock_clockwrlock, GLIBC_2_42); + +#if OTHER_SHLIB_COMPAT (libpthread, GLIBC_2_32, GLIBC_2_42) +compat_symbol (libpthread, __pthread_rwlock_clockwrlock, pthread_rwlock_clockwrlock, GLIBC_2_32); +#endif diff --git a/sysdeps/htl/pt-rwlock-wrlock.c b/sysdeps/htl/pt-rwlock-wrlock.c index 181aa6a91f..ca0e5b02e5 100644 --- a/sysdeps/htl/pt-rwlock-wrlock.c +++ b/sysdeps/htl/pt-rwlock-wrlock.c @@ -18,8 +18,8 @@ #include <pthread.h> #include <assert.h> - #include <pt-internal.h> +#include <shlib-compat.h> /* Implemented in pt-rwlock-timedwrlock.c. */ extern int __pthread_rwlock_timedwrlock_internal (struct __pthread_rwlock @@ -34,4 +34,9 @@ __pthread_rwlock_wrlock (struct __pthread_rwlock *rwlock) { return __pthread_rwlock_timedwrlock_internal (rwlock, -1, 0); } -weak_alias (__pthread_rwlock_wrlock, pthread_rwlock_wrlock); +libc_hidden_def (__pthread_rwlock_wrlock) +versioned_symbol (libc, __pthread_rwlock_wrlock, pthread_rwlock_wrlock, GLIBC_2_42); + +#if OTHER_SHLIB_COMPAT (libpthread, GLIBC_2_12, GLIBC_2_42) +compat_symbol (libpthread, __pthread_rwlock_wrlock, pthread_rwlock_wrlock, GLIBC_2_12); +#endif diff --git a/sysdeps/htl/pthread-functions.h b/sysdeps/htl/pthread-functions.h index 7dd6fadc17..467d0312e1 100644 --- a/sysdeps/htl/pthread-functions.h +++ b/sysdeps/htl/pthread-functions.h @@ -24,8 +24,6 @@ void __pthread_exit (void *) __attribute__ ((__noreturn__)); struct __pthread_cancelation_handler **__pthread_get_cleanup_stack (void); int __pthread_once (pthread_once_t *, void (*) (void)); -int __pthread_rwlock_rdlock (pthread_rwlock_t *); -int __pthread_rwlock_wrlock (pthread_rwlock_t *); int __pthread_key_create (pthread_key_t *, void (*) (void *)); void *__pthread_getspecific (pthread_key_t); int __pthread_setspecific (pthread_key_t, const void *); @@ -42,8 +40,6 @@ struct pthread_functions void (*ptr___pthread_exit) (void *) __attribute__ ((__noreturn__)); struct __pthread_cancelation_handler **(*ptr___pthread_get_cleanup_stack) (void); int (*ptr_pthread_once) (pthread_once_t *, void (*) (void)); - int (*ptr_pthread_rwlock_rdlock) (pthread_rwlock_t *); - int (*ptr_pthread_rwlock_wrlock) (pthread_rwlock_t *); int (*ptr___pthread_key_create) (pthread_key_t *, void (*) (void *)); void *(*ptr___pthread_getspecific) (pthread_key_t); int (*ptr___pthread_setspecific) (pthread_key_t, const void *); diff --git a/sysdeps/htl/pthreadP.h b/sysdeps/htl/pthreadP.h index d77cee51a5..9479b9ef24 100644 --- a/sysdeps/htl/pthreadP.h +++ b/sysdeps/htl/pthreadP.h @@ -114,6 +114,18 @@ libc_hidden_proto (__pthread_mutexattr_gettype) extern int __pthread_mutexattr_settype(pthread_mutexattr_t *__attr, int __type); libc_hidden_proto (__pthread_mutexattr_settype) +extern int __pthread_rwlock_clockrdlock (pthread_rwlock_t *__rwlock, + clockid_t __clockid, const struct timespec *__abstime); +libc_hidden_proto (__pthread_rwlock_clockrdlock) +extern int __pthread_rwlock_clockwrlock (pthread_rwlock_t *__rwlock, + clockid_t __clockid, const struct timespec *__abstime); +libc_hidden_proto (__pthread_rwlock_clockwrlock) +extern int __pthread_rwlock_timedrdlock (struct __pthread_rwlock *__rwlock, + const struct timespec *__abstime); +libc_hidden_proto (__pthread_rwlock_timedrdlock) +extern int __pthread_rwlock_timedwrlock (struct __pthread_rwlock *__rwlock, + const struct timespec *__abstime); +libc_hidden_proto (__pthread_rwlock_timedwrlock) extern int __pthread_rwlockattr_destroy (pthread_rwlockattr_t *__attr); libc_hidden_proto (__pthread_rwlockattr_destroy) extern int __pthread_rwlockattr_getpshared (const pthread_rwlockattr_t *__attr, |
