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>
This commit is contained in:
gfleury 2025-02-16 16:54:31 +02:00 committed by Samuel Thibault
parent 119798a7b1
commit 25650ef6b9
14 changed files with 95 additions and 40 deletions

View File

@ -47,10 +47,6 @@ libpthread-routines := \
pt-mutex-transfer-np \
pt-rwlock-init \
pt-rwlock-destroy \
pt-rwlock-rdlock \
pt-rwlock-wrlock \
pt-rwlock-timedrdlock \
pt-rwlock-timedwrlock \
pt-hurd-cond-wait \
pt-hurd-cond-timedwait \
pt-stack-alloc \
@ -194,9 +190,13 @@ routines := \
pt-nthreads \
pt-pthread_self \
pt-rwlock-attr \
pt-rwlock-rdlock \
pt-rwlock-timedrdlock \
pt-rwlock-timedwrlock \
pt-rwlock-tryrdlock \
pt-rwlock-trywrlock \
pt-rwlock-unlock \
pt-rwlock-wrlock \
pt-rwlockattr-destroy \
pt-rwlockattr-getpshared \
pt-rwlockattr-init \

View File

@ -63,9 +63,13 @@ libc {
pthread_mutexattr_setprotocol;
pthread_mutexattr_setpshared;
pthread_mutexattr_settype;
pthread_rwlock_rdlock;
pthread_rwlock_timedrdlock;
pthread_rwlock_timedwrlock;
pthread_rwlock_tryrdlock;
pthread_rwlock_trywrlock;
pthread_rwlock_unlock;
pthread_rwlock_wrlock;
pthread_rwlockattr_destroy;
pthread_rwlockattr_getpshared;
pthread_rwlockattr_init;
@ -109,6 +113,8 @@ libc {
pthread_mutexattr_getrobust; pthread_mutexattr_getrobust_np;
pthread_mutexattr_setrobust; pthread_mutexattr_setrobust_np;
pthread_rwlock_clockrdlock; pthread_rwlock_clockwrlock;
}
GLIBC_2.41 {
@ -149,6 +155,12 @@ libc {
pthread_mutex_getprioceiling;
pthread_mutex_setprioceiling;
pthread_mutex_trylock;
pthread_rwlock_clockrdlock;
pthread_rwlock_clockwrlock;
pthread_rwlock_rdlock;
pthread_rwlock_timedrdlock;
pthread_rwlock_timedwrlock;
pthread_rwlock_wrlock;
pthread_rwlock_tryrdlock;
pthread_rwlock_trywrlock;
pthread_rwlock_unlock;
@ -251,9 +263,7 @@ libpthread {
pthread_once;
pthread_rwlock_destroy; pthread_rwlock_init; pthread_rwlock_rdlock;
pthread_rwlock_timedrdlock; pthread_rwlock_timedwrlock;
pthread_rwlock_wrlock;
pthread_rwlock_destroy; pthread_rwlock_init;
pthread_setconcurrency;
pthread_setschedprio; pthread_setspecific;
@ -283,8 +293,6 @@ libpthread {
cnd_broadcast; cnd_destroy; cnd_init; cnd_signal; cnd_timedwait; cnd_wait;
tss_create; tss_delete; tss_get; tss_set;
pthread_rwlock_clockrdlock; pthread_rwlock_clockwrlock;
pthread_tryjoin_np; pthread_timedjoin_np; pthread_clockjoin_np;
sem_clockwait;

View File

@ -30,8 +30,6 @@ static const struct pthread_functions pthread_functions = {
.ptr___pthread_exit = __pthread_exit,
.ptr___pthread_get_cleanup_stack = __pthread_get_cleanup_stack,
.ptr_pthread_once = __pthread_once,
.ptr_pthread_rwlock_rdlock = __pthread_rwlock_rdlock,
.ptr_pthread_rwlock_wrlock = __pthread_rwlock_wrlock,
.ptr___pthread_key_create = __pthread_key_create,
.ptr___pthread_getspecific = __pthread_getspecific,
.ptr___pthread_setspecific = __pthread_setspecific,

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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 *);

View File

@ -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,

View File

@ -88,9 +88,13 @@ GLIBC_2.12 pthread_mutexattr_setprioceiling F
GLIBC_2.12 pthread_mutexattr_setprotocol F
GLIBC_2.12 pthread_mutexattr_setpshared F
GLIBC_2.12 pthread_mutexattr_settype F
GLIBC_2.12 pthread_rwlock_rdlock F
GLIBC_2.12 pthread_rwlock_timedrdlock F
GLIBC_2.12 pthread_rwlock_timedwrlock F
GLIBC_2.12 pthread_rwlock_tryrdlock F
GLIBC_2.12 pthread_rwlock_trywrlock F
GLIBC_2.12 pthread_rwlock_unlock F
GLIBC_2.12 pthread_rwlock_wrlock F
GLIBC_2.12 pthread_rwlockattr_destroy F
GLIBC_2.12 pthread_rwlockattr_getpshared F
GLIBC_2.12 pthread_rwlockattr_init F
@ -2294,6 +2298,8 @@ GLIBC_2.32 pthread_mutexattr_getrobust F
GLIBC_2.32 pthread_mutexattr_getrobust_np F
GLIBC_2.32 pthread_mutexattr_setrobust F
GLIBC_2.32 pthread_mutexattr_setrobust_np F
GLIBC_2.32 pthread_rwlock_clockrdlock F
GLIBC_2.32 pthread_rwlock_clockwrlock F
GLIBC_2.32 sigabbrev_np F
GLIBC_2.32 sigdescr_np F
GLIBC_2.32 strerrordesc_np F
@ -2587,9 +2593,15 @@ GLIBC_2.42 pthread_mutex_consistent_np F
GLIBC_2.42 pthread_mutex_getprioceiling F
GLIBC_2.42 pthread_mutex_setprioceiling F
GLIBC_2.42 pthread_mutex_trylock F
GLIBC_2.42 pthread_rwlock_clockrdlock F
GLIBC_2.42 pthread_rwlock_clockwrlock F
GLIBC_2.42 pthread_rwlock_rdlock F
GLIBC_2.42 pthread_rwlock_timedrdlock F
GLIBC_2.42 pthread_rwlock_timedwrlock F
GLIBC_2.42 pthread_rwlock_tryrdlock F
GLIBC_2.42 pthread_rwlock_trywrlock F
GLIBC_2.42 pthread_rwlock_unlock F
GLIBC_2.42 pthread_rwlock_wrlock F
GLIBC_2.42 pthread_rwlockattr_destroy F
GLIBC_2.42 pthread_rwlockattr_getpshared F
GLIBC_2.42 pthread_rwlockattr_init F

View File

@ -38,10 +38,6 @@ GLIBC_2.12 pthread_mutex_transfer_np F
GLIBC_2.12 pthread_once F
GLIBC_2.12 pthread_rwlock_destroy F
GLIBC_2.12 pthread_rwlock_init F
GLIBC_2.12 pthread_rwlock_rdlock F
GLIBC_2.12 pthread_rwlock_timedrdlock F
GLIBC_2.12 pthread_rwlock_timedwrlock F
GLIBC_2.12 pthread_rwlock_wrlock F
GLIBC_2.12 pthread_setconcurrency F
GLIBC_2.12 pthread_setschedprio F
GLIBC_2.12 pthread_setspecific F
@ -83,8 +79,6 @@ GLIBC_2.32 mtx_timedlock F
GLIBC_2.32 mtx_trylock F
GLIBC_2.32 mtx_unlock F
GLIBC_2.32 pthread_clockjoin_np F
GLIBC_2.32 pthread_rwlock_clockrdlock F
GLIBC_2.32 pthread_rwlock_clockwrlock F
GLIBC_2.32 pthread_timedjoin_np F
GLIBC_2.32 pthread_tryjoin_np F
GLIBC_2.32 sem_clockwait F

View File

@ -1579,9 +1579,15 @@ GLIBC_2.38 pthread_mutexattr_setpshared F
GLIBC_2.38 pthread_mutexattr_setrobust F
GLIBC_2.38 pthread_mutexattr_setrobust_np F
GLIBC_2.38 pthread_mutexattr_settype F
GLIBC_2.38 pthread_rwlock_clockrdlock F
GLIBC_2.38 pthread_rwlock_clockwrlock F
GLIBC_2.38 pthread_rwlock_rdlock F
GLIBC_2.38 pthread_rwlock_timedrdlock F
GLIBC_2.38 pthread_rwlock_timedwrlock F
GLIBC_2.38 pthread_rwlock_tryrdlock F
GLIBC_2.38 pthread_rwlock_trywrlock F
GLIBC_2.38 pthread_rwlock_unlock F
GLIBC_2.38 pthread_rwlock_wrlock F
GLIBC_2.38 pthread_rwlockattr_destroy F
GLIBC_2.38 pthread_rwlockattr_getpshared F
GLIBC_2.38 pthread_rwlockattr_init F
@ -2270,9 +2276,15 @@ GLIBC_2.42 pthread_mutex_consistent_np F
GLIBC_2.42 pthread_mutex_getprioceiling F
GLIBC_2.42 pthread_mutex_setprioceiling F
GLIBC_2.42 pthread_mutex_trylock F
GLIBC_2.42 pthread_rwlock_clockrdlock F
GLIBC_2.42 pthread_rwlock_clockwrlock F
GLIBC_2.42 pthread_rwlock_rdlock F
GLIBC_2.42 pthread_rwlock_timedrdlock F
GLIBC_2.42 pthread_rwlock_timedwrlock F
GLIBC_2.42 pthread_rwlock_tryrdlock F
GLIBC_2.42 pthread_rwlock_trywrlock F
GLIBC_2.42 pthread_rwlock_unlock F
GLIBC_2.42 pthread_rwlock_wrlock F
GLIBC_2.42 pthread_rwlockattr_destroy F
GLIBC_2.42 pthread_rwlockattr_getpshared F
GLIBC_2.42 pthread_rwlockattr_init F

View File

@ -56,14 +56,8 @@ GLIBC_2.38 pthread_key_delete F
GLIBC_2.38 pthread_kill F
GLIBC_2.38 pthread_mutex_transfer_np F
GLIBC_2.38 pthread_once F
GLIBC_2.38 pthread_rwlock_clockrdlock F
GLIBC_2.38 pthread_rwlock_clockwrlock F
GLIBC_2.38 pthread_rwlock_destroy F
GLIBC_2.38 pthread_rwlock_init F
GLIBC_2.38 pthread_rwlock_rdlock F
GLIBC_2.38 pthread_rwlock_timedrdlock F
GLIBC_2.38 pthread_rwlock_timedwrlock F
GLIBC_2.38 pthread_rwlock_wrlock F
GLIBC_2.38 pthread_setconcurrency F
GLIBC_2.38 pthread_setschedprio F
GLIBC_2.38 pthread_setspecific F