From patchwork Wed Jan 29 01:33:38 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Samuel Thibault X-Patchwork-Id: 105582 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id F23593857BA5 for ; Wed, 29 Jan 2025 01:35:38 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org F23593857BA5 X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from sonata.ens-lyon.org (sonata.ens-lyon.org [140.77.166.138]) by sourceware.org (Postfix) with ESMTPS id EBECE3858D3C for ; Wed, 29 Jan 2025 01:33:45 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org EBECE3858D3C Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=ens-lyon.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=bounce.ens-lyon.org ARC-Filter: OpenARC Filter v1.0.0 sourceware.org EBECE3858D3C Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=140.77.166.138 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1738114426; cv=none; b=X16srPNQmST7+OIW3BMo4M+Jw4W2K19g3XWLYRJ7SY3zb2OMlRXCDiCQq5Eu08m4A6u9sjpcrBGKehB/n3ctj1TWaiS/vY7w7szOkSF6kGmykZLkY8VA2gzALid0R5AkxQjt3DJrqsmtK1FNtxUBB3aLZeTxp+582c506wxz5E8= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1738114426; c=relaxed/simple; bh=8tJtOTokU8UL5HPJre7C7BZkRpRduDZnLYTNp85feTQ=; h=From:To:Subject:Date:Message-ID:MIME-Version; b=Xox0XJqExUeaRhn0R20Rzl6T2SwLdt6u99gDWsMAsyCWxXdMTggFYlJW+LaZOcYGeMCJ5QIfluAIJSYxzVjFXuhPkeL5aFxaeDGVs1UZeR5PiR+13IovxSVL4zvkonaH+UoMAEtunxp+DJOY761gQnP9Gy5JflAFX4ltqDIng64= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org EBECE3858D3C Received: from localhost (localhost [127.0.0.1]) by sonata.ens-lyon.org (Postfix) with ESMTP id 9BC7CA19AA; Wed, 29 Jan 2025 02:33:44 +0100 (CET) Received: from sonata.ens-lyon.org ([127.0.0.1]) by localhost (sonata.ens-lyon.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 1xpPMwXnScf3; Wed, 29 Jan 2025 02:33:44 +0100 (CET) Received: from begin (aamiens-653-1-40-48.w83-192.abo.wanadoo.fr [83.192.199.48]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by sonata.ens-lyon.org (Postfix) with ESMTPSA id 2EAB1A19A2; Wed, 29 Jan 2025 02:33:44 +0100 (CET) Received: from samy by begin with local (Exim 4.98) (envelope-from ) id 1tcwxb-0000000AtTx-2w9i; Wed, 29 Jan 2025 02:33:43 +0100 From: Samuel Thibault To: libc-alpha@sourceware.org Cc: gfleury , commit-hurd@gnu.org Subject: [hurd, commited 3/7] htl: move pthread_mutex_{lock, unlock, trylock, timedlock, clocklock} Date: Wed, 29 Jan 2025 02:33:38 +0100 Message-ID: <20250129013342.2596522-4-samuel.thibault@ens-lyon.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20250129013342.2596522-1-samuel.thibault@ens-lyon.org> References: <20250129013342.2596522-1-samuel.thibault@ens-lyon.org> MIME-Version: 1.0 X-Spam-Status: No, score=-13.2 required=5.0 tests=BAYES_00, GIT_PATCH_0, JMQ_SPF_NEUTRAL, KAM_DMARC_STATUS, KAM_SHORT, SPF_HELO_PASS, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libc-alpha-bounces~patchwork=sourceware.org@sourceware.org From: gfleury I haven't exposed _pthread_mutex_lock, _pthread_mutex_trylock and _pthread_mutex_unlock in GLIBC_PRIVATE since there aren't used in any code in libpthread Message-ID: <20250103103750.870897-3-gfleury@disroot.org> --- htl/Makefile | 8 +++---- htl/Versions | 25 +++++++++++++-------- htl/forward.c | 4 ---- htl/pt-initialize.c | 3 --- hurd/hurdlock.c | 6 +++++ hurd/hurdlock.h | 5 +++++ sysdeps/htl/libc-lockP.h | 6 ----- sysdeps/htl/pthread-functions.h | 6 ----- sysdeps/htl/pthreadP.h | 11 +++++---- sysdeps/htl/timer_routines.c | 12 +++++----- sysdeps/mach/hurd/htl/pt-mutex-lock.c | 11 +++++---- sysdeps/mach/hurd/htl/pt-mutex-timedlock.c | 5 +++-- sysdeps/mach/hurd/htl/pt-mutex-trylock.c | 11 +++++---- sysdeps/mach/hurd/htl/pt-mutex-unlock.c | 11 +++++---- sysdeps/mach/hurd/i386/libc.abilist | 6 +++++ sysdeps/mach/hurd/i386/libpthread.abilist | 5 ----- sysdeps/mach/hurd/x86_64/libc.abilist | 4 ++++ sysdeps/mach/hurd/x86_64/libpthread.abilist | 5 ----- 18 files changed, 78 insertions(+), 66 deletions(-) diff --git a/htl/Makefile b/htl/Makefile index f381499ff7..0d3e78dee5 100644 --- a/htl/Makefile +++ b/htl/Makefile @@ -55,10 +55,6 @@ libpthread-routines := \ pt-testcancel \ pt-cancel \ pt-mutex-destroy \ - pt-mutex-lock \ - pt-mutex-trylock \ - pt-mutex-timedlock \ - pt-mutex-unlock \ pt-mutex-transfer-np \ pt-mutex-getprioceiling \ pt-mutex-setprioceiling \ @@ -189,6 +185,10 @@ routines := \ pt-getschedparam \ pt-mutex-checklocked \ pt-mutex-init \ + pt-mutex-lock \ + pt-mutex-timedlock \ + pt-mutex-trylock \ + pt-mutex-unlock \ pt-mutexattr-destroy \ pt-mutexattr-getprioceiling \ pt-mutexattr-getprotocol \ diff --git a/htl/Versions b/htl/Versions index caa5653e6c..757cefef61 100644 --- a/htl/Versions +++ b/htl/Versions @@ -39,6 +39,10 @@ libc { pthread_condattr_setclock; pthread_condattr_setpshared; pthread_mutex_init; + pthread_mutex_lock; + pthread_mutex_timedlock; + pthread_mutex_trylock; + pthread_mutex_unlock; pthread_mutexattr_destroy; pthread_mutexattr_getprioceiling; pthread_mutexattr_getprotocol; @@ -66,7 +70,7 @@ libc { pthread_equal; pthread_exit; pthread_getschedparam; pthread_setschedparam; pthread_mutex_destroy; pthread_mutex_init; - pthread_mutex_lock; pthread_mutex_trylock; pthread_mutex_unlock; + pthread_mutex_lock; pthread_mutex_unlock; pthread_self; pthread_setcancelstate; pthread_setcanceltype; __pthread_get_cleanup_stack; } @@ -80,6 +84,8 @@ libc { pthread_cond_clockwait; + pthread_mutex_clocklock; + pthread_mutexattr_getrobust; pthread_mutexattr_getrobust_np; pthread_mutexattr_setrobust; pthread_mutexattr_setrobust_np; } @@ -110,6 +116,9 @@ libc { pthread_sigmask; } + GLIBC_2.42 { + pthread_mutex_trylock; + } GLIBC_PRIVATE { __libc_alloca_cutoff; @@ -139,6 +148,10 @@ libc { __pthread_default_condattr; __pthread_mutex_checklocked; __pthread_mutex_init; + __pthread_mutex_lock; + __pthread_mutex_timedlock; + __pthread_mutex_trylock; + __pthread_mutex_unlock; __pthread_mutexattr_destroy; __pthread_mutexattr_init; __pthread_mutexattr_settype; @@ -198,9 +211,8 @@ libpthread { __pthread_kill; pthread_mutex_destroy; pthread_mutex_getprioceiling; - pthread_mutex_lock; pthread_mutex_setprioceiling; - pthread_mutex_timedlock; pthread_mutex_transfer_np; - pthread_mutex_trylock; pthread_mutex_unlock; + pthread_mutex_setprioceiling; + pthread_mutex_transfer_np; pthread_once; @@ -242,7 +254,6 @@ libpthread { tss_create; tss_delete; tss_get; tss_set; pthread_mutex_consistent; pthread_mutex_consistent_np; - pthread_mutex_clocklock; pthread_rwlock_clockrdlock; pthread_rwlock_clockwrlock; @@ -270,12 +281,8 @@ libpthread { __pthread_setspecific; __pthread_getattr_np; __pthread_mutex_destroy; - __pthread_mutex_timedlock; __pthread_enable_asynccancel; __pthread_disable_asynccancel; - - __pthread_mutex_lock; __pthread_mutex_trylock; __pthread_mutex_unlock; - _pthread_mutex_lock; _pthread_mutex_trylock; _pthread_mutex_unlock; _pthread_rwlock_destroy; _pthread_rwlock_init; } } diff --git a/htl/forward.c b/htl/forward.c index e78637567f..b71099b82b 100644 --- a/htl/forward.c +++ b/htl/forward.c @@ -60,10 +60,6 @@ strong_alias (__pthread_exit, pthread_exit); FORWARD (pthread_mutex_destroy, (pthread_mutex_t *mutex), (mutex), 0) -FORWARD (pthread_mutex_lock, (pthread_mutex_t *mutex), (mutex), 0) - -FORWARD (pthread_mutex_unlock, (pthread_mutex_t *mutex), (mutex), 0) - FORWARD (__pthread_setcancelstate, (int state, int *oldstate), (state, oldstate), 0) strong_alias (__pthread_setcancelstate, pthread_setcancelstate); diff --git a/htl/pt-initialize.c b/htl/pt-initialize.c index 606a085dd0..b8f8c95ce3 100644 --- a/htl/pt-initialize.c +++ b/htl/pt-initialize.c @@ -29,9 +29,6 @@ static const struct pthread_functions pthread_functions = { .ptr___pthread_exit = __pthread_exit, .ptr_pthread_mutex_destroy = __pthread_mutex_destroy, - .ptr_pthread_mutex_lock = __pthread_mutex_lock, - .ptr_pthread_mutex_trylock = __pthread_mutex_trylock, - .ptr_pthread_mutex_unlock = __pthread_mutex_unlock, .ptr___pthread_setcancelstate = __pthread_setcancelstate, .ptr_pthread_setcanceltype = __pthread_setcanceltype, .ptr___pthread_get_cleanup_stack = __pthread_get_cleanup_stack, diff --git a/hurd/hurdlock.c b/hurd/hurdlock.c index 374e4d107a..c771662e84 100644 --- a/hurd/hurdlock.c +++ b/hurd/hurdlock.c @@ -99,6 +99,7 @@ __lll_abstimed_lock (void *ptr, return ETIMEDOUT; } } +libc_hidden_def (__lll_abstimed_lock) /* Robust locks. */ @@ -157,6 +158,7 @@ __lll_robust_lock (void *ptr, int flags) } } } +libc_hidden_def (__lll_robust_lock) int __lll_robust_abstimed_lock (void *ptr, @@ -206,6 +208,7 @@ __lll_robust_abstimed_lock (void *ptr, } } } +libc_hidden_def (__lll_robust_abstimed_lock) int __lll_robust_trylock (void *ptr) @@ -225,6 +228,7 @@ __lll_robust_trylock (void *ptr) return EBUSY; } +libc_hidden_def (__lll_robust_trylock) void __lll_robust_unlock (void *ptr, int flags) @@ -241,3 +245,5 @@ __lll_robust_unlock (void *ptr, int flags) break; } } + +libc_hidden_def (__lll_robust_unlock) diff --git a/hurd/hurdlock.h b/hurd/hurdlock.h index c013c5994c..0cfccc562c 100644 --- a/hurd/hurdlock.h +++ b/hurd/hurdlock.h @@ -68,23 +68,27 @@ extern int __lll_abstimed_xwait (void *__ptr, int __lo, int __hi, using clock CLK. */ extern int __lll_abstimed_lock (void *__ptr, const struct timespec *__tsp, int __flags, int __clk); +libc_hidden_proto (__lll_abstimed_lock) /* Acquire the lock at PTR, but return with an error if the process containing the owner thread dies. */ extern int __lll_robust_lock (void *__ptr, int __flags); #define lll_robust_lock(var, flags) \ __lll_robust_lock (&(var), flags) +libc_hidden_proto (__lll_robust_lock) /* Same as '__lll_robust_lock', but only block until TSP elapses, using clock CLK. */ extern int __lll_robust_abstimed_lock (void *__ptr, const struct timespec *__tsp, int __flags, int __clk); +libc_hidden_proto (__lll_robust_abstimed_lock) /* Same as '__lll_robust_lock', but return with an error if the lock cannot be acquired without blocking. */ extern int __lll_robust_trylock (void *__ptr); #define lll_robust_trylock(var) \ __lll_robust_trylock (&(var)) +libc_hidden_proto (__lll_robust_trylock) /* Wake one or more threads waiting on address PTR, setting its value to VAL before doing so. */ @@ -96,6 +100,7 @@ extern int __lll_robust_trylock (void *__ptr); extern void __lll_robust_unlock (void *__ptr, int __flags); #define lll_robust_unlock(var, flags) \ __lll_robust_unlock (&(var), flags) +libc_hidden_proto (__lll_robust_unlock) /* Rearrange threads waiting on address SRC to instead wait on DST, waking one of them if WAIT_ONE is non-zero. */ diff --git a/sysdeps/htl/libc-lockP.h b/sysdeps/htl/libc-lockP.h index 6c13382a21..3d74cd87e9 100644 --- a/sysdeps/htl/libc-lockP.h +++ b/sysdeps/htl/libc-lockP.h @@ -118,9 +118,6 @@ extern int __pthread_atfork (void (*__prepare) (void), #if !defined(__NO_WEAK_PTHREAD_ALIASES) && !IS_IN (libpthread) # ifdef weak_extern weak_extern (__pthread_mutex_destroy) -weak_extern (__pthread_mutex_lock) -weak_extern (__pthread_mutex_trylock) -weak_extern (__pthread_mutex_unlock) weak_extern (__pthread_rwlock_init) weak_extern (__pthread_rwlock_destroy) weak_extern (__pthread_rwlock_rdlock) @@ -137,9 +134,6 @@ weak_extern (__pthread_atfork) weak_extern (__pthread_setcancelstate) # else # pragma weak __pthread_mutex_destroy -# pragma weak __pthread_mutex_lock -# pragma weak __pthread_mutex_trylock -# pragma weak __pthread_mutex_unlock # pragma weak __pthread_rwlock_destroy # pragma weak __pthread_rwlock_rdlock # pragma weak __pthread_rwlock_tryrdlock diff --git a/sysdeps/htl/pthread-functions.h b/sysdeps/htl/pthread-functions.h index 54b773344d..c44c9038f3 100644 --- a/sysdeps/htl/pthread-functions.h +++ b/sysdeps/htl/pthread-functions.h @@ -23,9 +23,6 @@ void __pthread_exit (void *) __attribute__ ((__noreturn__)); int _pthread_mutex_destroy (pthread_mutex_t *); -int __pthread_mutex_lock (pthread_mutex_t *); -int __pthread_mutex_trylock (pthread_mutex_t *); -int __pthread_mutex_unlock (pthread_mutex_t *); int __pthread_setcancelstate (int, int *); int __pthread_setcanceltype (int, int *); struct __pthread_cancelation_handler **__pthread_get_cleanup_stack (void); @@ -48,9 +45,6 @@ struct pthread_functions { void (*ptr___pthread_exit) (void *) __attribute__ ((__noreturn__)); int (*ptr_pthread_mutex_destroy) (pthread_mutex_t *); - int (*ptr_pthread_mutex_lock) (pthread_mutex_t *); - int (*ptr_pthread_mutex_trylock) (pthread_mutex_t *); - int (*ptr_pthread_mutex_unlock) (pthread_mutex_t *); int (*ptr___pthread_setcancelstate) (int, int *); int (*ptr_pthread_setcanceltype) (int, int *); struct __pthread_cancelation_handler **(*ptr___pthread_get_cleanup_stack) (void); diff --git a/sysdeps/htl/pthreadP.h b/sysdeps/htl/pthreadP.h index bb17391cb3..a2a0a932b7 100644 --- a/sysdeps/htl/pthreadP.h +++ b/sysdeps/htl/pthreadP.h @@ -33,12 +33,19 @@ extern void __pthread_init_static_tls (struct link_map *) attribute_hidden; extern int __pthread_mutex_init (pthread_mutex_t *__mutex, const pthread_mutexattr_t *__attr); libc_hidden_proto (__pthread_mutex_init) +extern int __pthread_mutex_clocklock (pthread_mutex_t *__mutex, clockid_t __clockid, + const struct timespec *__abstime); +libc_hidden_proto (__pthread_mutex_clocklock) extern int __pthread_mutex_destroy (pthread_mutex_t *__mutex); extern int __pthread_mutex_lock (pthread_mutex_t *__mutex); +libc_hidden_proto (__pthread_mutex_lock) extern int __pthread_mutex_trylock (pthread_mutex_t *_mutex); +libc_hidden_proto (__pthread_mutex_trylock) extern int __pthread_mutex_timedlock (pthread_mutex_t *__mutex, const struct timespec *__abstime); +libc_hidden_proto (__pthread_mutex_timedlock) extern int __pthread_mutex_unlock (pthread_mutex_t *__mutex); +libc_hidden_proto (__pthread_mutex_unlock) extern int __pthread_mutexattr_getpshared(const pthread_mutexattr_t *__restrict __attr, int *__restrict __pshared); libc_hidden_proto (__pthread_mutexattr_getpshared) @@ -164,10 +171,6 @@ hidden_proto (__pthread_key_create) hidden_proto (__pthread_getspecific) hidden_proto (__pthread_setspecific) hidden_proto (__pthread_mutex_destroy) -hidden_proto (__pthread_mutex_lock) -hidden_proto (__pthread_mutex_trylock) -hidden_proto (__pthread_mutex_unlock) -hidden_proto (__pthread_mutex_timedlock) hidden_proto (__pthread_get_cleanup_stack) #endif diff --git a/sysdeps/htl/timer_routines.c b/sysdeps/htl/timer_routines.c index 2039e0ba2e..d6ee65d69b 100644 --- a/sysdeps/htl/timer_routines.c +++ b/sysdeps/htl/timer_routines.c @@ -265,7 +265,7 @@ thread_cleanup (void *val) /* How did the signal thread get killed? */ assert (thread != &__timer_signal_thread_rclk); - pthread_mutex_lock (&__timer_mutex); + __pthread_mutex_lock (&__timer_mutex); thread->exists = 0; @@ -277,7 +277,7 @@ thread_cleanup (void *val) else (void) __timer_thread_start (thread); - pthread_mutex_unlock (&__timer_mutex); + __pthread_mutex_unlock (&__timer_mutex); /* Unblock potentially blocked timer_delete(). */ __pthread_cond_broadcast (&thread->cond); @@ -291,7 +291,7 @@ thread_expire_timer (struct thread_node *self, struct timer_node *timer) { self->current_timer = timer; /* Lets timer_delete know timer is running. */ - pthread_mutex_unlock (&__timer_mutex); + __pthread_mutex_unlock (&__timer_mutex); switch (__builtin_expect (timer->event.sigev_notify, SIGEV_SIGNAL)) { @@ -334,7 +334,7 @@ thread_expire_timer (struct thread_node *self, struct timer_node *timer) break; } - pthread_mutex_lock (&__timer_mutex); + __pthread_mutex_lock (&__timer_mutex); self->current_timer = 0; @@ -358,7 +358,7 @@ thread_func (void *arg) pthread_cleanup_push (thread_cleanup, self); - pthread_mutex_lock (&__timer_mutex); + __pthread_mutex_lock (&__timer_mutex); while (1) { @@ -550,5 +550,5 @@ __timer_dealloc (struct timer_node *timer) void __timer_mutex_cancel_handler (void *arg) { - pthread_mutex_unlock (arg); + __pthread_mutex_unlock (arg); } diff --git a/sysdeps/mach/hurd/htl/pt-mutex-lock.c b/sysdeps/mach/hurd/htl/pt-mutex-lock.c index e1e40d8db5..7d93ddd660 100644 --- a/sysdeps/mach/hurd/htl/pt-mutex-lock.c +++ b/sysdeps/mach/hurd/htl/pt-mutex-lock.c @@ -16,13 +16,14 @@ License along with the GNU C Library; if not, see . */ -#include +#include #include #include #include #include "pt-mutex.h" #include #include +#include int __pthread_mutex_lock (pthread_mutex_t *mtxp) @@ -76,7 +77,9 @@ __pthread_mutex_lock (pthread_mutex_t *mtxp) return ret; } +libc_hidden_def (__pthread_mutex_lock) +versioned_symbol (libc, __pthread_mutex_lock, pthread_mutex_lock, GLIBC_2_21); -hidden_def (__pthread_mutex_lock) -strong_alias (__pthread_mutex_lock, _pthread_mutex_lock) -weak_alias (__pthread_mutex_lock, pthread_mutex_lock) +#if OTHER_SHLIB_COMPAT (libpthread, GLIBC_2_12, GLIBC_2_21) +compat_symbol (libc, __pthread_mutex_lock, pthread_mutex_lock, GLIBC_2_12); +#endif diff --git a/sysdeps/mach/hurd/htl/pt-mutex-timedlock.c b/sysdeps/mach/hurd/htl/pt-mutex-timedlock.c index 71ce28a319..90fa407e99 100644 --- a/sysdeps/mach/hurd/htl/pt-mutex-timedlock.c +++ b/sysdeps/mach/hurd/htl/pt-mutex-timedlock.c @@ -16,7 +16,7 @@ License along with the GNU C Library; if not, see . */ -#include +#include #include #include #include @@ -79,6 +79,7 @@ __pthread_mutex_clocklock (pthread_mutex_t *mtxp, return ret; } +libc_hidden_def (__pthread_mutex_clocklock) weak_alias (__pthread_mutex_clocklock, pthread_mutex_clocklock) int @@ -87,5 +88,5 @@ __pthread_mutex_timedlock (pthread_mutex_t *mutex, { return __pthread_mutex_clocklock (mutex, CLOCK_REALTIME, tsp); } +libc_hidden_def (__pthread_mutex_timedlock) weak_alias (__pthread_mutex_timedlock, pthread_mutex_timedlock) -hidden_def (__pthread_mutex_timedlock) diff --git a/sysdeps/mach/hurd/htl/pt-mutex-trylock.c b/sysdeps/mach/hurd/htl/pt-mutex-trylock.c index 5435921231..f1b451e803 100644 --- a/sysdeps/mach/hurd/htl/pt-mutex-trylock.c +++ b/sysdeps/mach/hurd/htl/pt-mutex-trylock.c @@ -16,13 +16,14 @@ License along with the GNU C Library; if not, see . */ -#include +#include #include #include #include #include "pt-mutex.h" #include #include +#include int __pthread_mutex_trylock (pthread_mutex_t *mtxp) @@ -80,7 +81,9 @@ __pthread_mutex_trylock (pthread_mutex_t *mtxp) return ret; } +libc_hidden_def (__pthread_mutex_trylock) +versioned_symbol (libc, __pthread_mutex_trylock, pthread_mutex_trylock, GLIBC_2_42); -hidden_def (__pthread_mutex_trylock) -strong_alias (__pthread_mutex_trylock, _pthread_mutex_trylock) -weak_alias (__pthread_mutex_trylock, pthread_mutex_trylock) +#if OTHER_SHLIB_COMPAT (libpthread, GLIBC_2_12, GLIBC_2_42) +compat_symbol (libc, __pthread_mutex_trylock, pthread_mutex_trylock, GLIBC_2_12); +#endif diff --git a/sysdeps/mach/hurd/htl/pt-mutex-unlock.c b/sysdeps/mach/hurd/htl/pt-mutex-unlock.c index b140416163..1732c34136 100644 --- a/sysdeps/mach/hurd/htl/pt-mutex-unlock.c +++ b/sysdeps/mach/hurd/htl/pt-mutex-unlock.c @@ -16,13 +16,14 @@ License along with the GNU C Library; if not, see . */ -#include +#include #include #include #include #include "pt-mutex.h" #include #include +#include int __pthread_mutex_unlock (pthread_mutex_t *mtxp) @@ -87,7 +88,9 @@ __pthread_mutex_unlock (pthread_mutex_t *mtxp) return ret; } +libc_hidden_def (__pthread_mutex_unlock) +versioned_symbol (libc, __pthread_mutex_unlock, pthread_mutex_unlock, GLIBC_2_21); -hidden_def (__pthread_mutex_unlock) -strong_alias (__pthread_mutex_unlock, _pthread_mutex_unlock) -weak_alias (__pthread_mutex_unlock, pthread_mutex_unlock) +#if OTHER_SHLIB_COMPAT (libpthread, GLIBC_2_12, GLIBC_2_21) +compat_symbol (libc, __pthread_mutex_unlock, pthread_mutex_unlock, GLIBC_2_12); +#endif diff --git a/sysdeps/mach/hurd/i386/libc.abilist b/sysdeps/mach/hurd/i386/libc.abilist index e9559bd265..aba93a281b 100644 --- a/sysdeps/mach/hurd/i386/libc.abilist +++ b/sysdeps/mach/hurd/i386/libc.abilist @@ -64,6 +64,10 @@ GLIBC_2.12 pthread_condattr_setpshared F GLIBC_2.12 pthread_equal F GLIBC_2.12 pthread_getschedparam F GLIBC_2.12 pthread_mutex_init F +GLIBC_2.12 pthread_mutex_lock F +GLIBC_2.12 pthread_mutex_timedlock F +GLIBC_2.12 pthread_mutex_trylock F +GLIBC_2.12 pthread_mutex_unlock F GLIBC_2.12 pthread_mutexattr_destroy F GLIBC_2.12 pthread_mutexattr_getprioceiling F GLIBC_2.12 pthread_mutexattr_getprotocol F @@ -2264,6 +2268,7 @@ GLIBC_2.32 __libc_single_threaded D 0x1 GLIBC_2.32 mach_print F GLIBC_2.32 mremap F GLIBC_2.32 pthread_cond_clockwait F +GLIBC_2.32 pthread_mutex_clocklock F GLIBC_2.32 pthread_mutexattr_getrobust F GLIBC_2.32 pthread_mutexattr_getrobust_np F GLIBC_2.32 pthread_mutexattr_setrobust F @@ -2549,6 +2554,7 @@ GLIBC_2.41 pthread_mutexattr_setrobust F GLIBC_2.41 pthread_mutexattr_setrobust_np F GLIBC_2.41 pthread_mutexattr_settype F GLIBC_2.41 pthread_sigmask F +GLIBC_2.42 pthread_mutex_trylock F GLIBC_2.5 __readlinkat_chk F GLIBC_2.5 inet6_opt_append F GLIBC_2.5 inet6_opt_find F diff --git a/sysdeps/mach/hurd/i386/libpthread.abilist b/sysdeps/mach/hurd/i386/libpthread.abilist index 6b330744bb..8c53b8d0ee 100644 --- a/sysdeps/mach/hurd/i386/libpthread.abilist +++ b/sysdeps/mach/hurd/i386/libpthread.abilist @@ -43,12 +43,8 @@ GLIBC_2.12 pthread_key_delete F GLIBC_2.12 pthread_kill F GLIBC_2.12 pthread_mutex_destroy F GLIBC_2.12 pthread_mutex_getprioceiling F -GLIBC_2.12 pthread_mutex_lock F GLIBC_2.12 pthread_mutex_setprioceiling F -GLIBC_2.12 pthread_mutex_timedlock F GLIBC_2.12 pthread_mutex_transfer_np F -GLIBC_2.12 pthread_mutex_trylock F -GLIBC_2.12 pthread_mutex_unlock F GLIBC_2.12 pthread_once F GLIBC_2.12 pthread_rwlock_destroy F GLIBC_2.12 pthread_rwlock_init F @@ -106,7 +102,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_mutex_clocklock F GLIBC_2.32 pthread_mutex_consistent F GLIBC_2.32 pthread_mutex_consistent_np F GLIBC_2.32 pthread_rwlock_clockrdlock F diff --git a/sysdeps/mach/hurd/x86_64/libc.abilist b/sysdeps/mach/hurd/x86_64/libc.abilist index aaf55cbaf4..2251371451 100644 --- a/sysdeps/mach/hurd/x86_64/libc.abilist +++ b/sysdeps/mach/hurd/x86_64/libc.abilist @@ -1547,9 +1547,12 @@ GLIBC_2.38 pthread_condattr_setpshared F GLIBC_2.38 pthread_equal F GLIBC_2.38 pthread_exit F GLIBC_2.38 pthread_getschedparam F +GLIBC_2.38 pthread_mutex_clocklock F GLIBC_2.38 pthread_mutex_destroy F GLIBC_2.38 pthread_mutex_init F GLIBC_2.38 pthread_mutex_lock F +GLIBC_2.38 pthread_mutex_timedlock F +GLIBC_2.38 pthread_mutex_trylock F GLIBC_2.38 pthread_mutex_unlock F GLIBC_2.38 pthread_mutexattr_destroy F GLIBC_2.38 pthread_mutexattr_getprioceiling F @@ -2237,6 +2240,7 @@ GLIBC_2.41 pthread_mutexattr_setrobust F GLIBC_2.41 pthread_mutexattr_setrobust_np F GLIBC_2.41 pthread_mutexattr_settype F GLIBC_2.41 pthread_sigmask F +GLIBC_2.42 pthread_mutex_trylock F HURD_CTHREADS_0.3 __cthread_getspecific F HURD_CTHREADS_0.3 __cthread_keycreate F HURD_CTHREADS_0.3 __cthread_setspecific F diff --git a/sysdeps/mach/hurd/x86_64/libpthread.abilist b/sysdeps/mach/hurd/x86_64/libpthread.abilist index 047d685a78..bd5e12adcc 100644 --- a/sysdeps/mach/hurd/x86_64/libpthread.abilist +++ b/sysdeps/mach/hurd/x86_64/libpthread.abilist @@ -61,17 +61,12 @@ GLIBC_2.38 pthread_join F GLIBC_2.38 pthread_key_create F GLIBC_2.38 pthread_key_delete F GLIBC_2.38 pthread_kill F -GLIBC_2.38 pthread_mutex_clocklock F GLIBC_2.38 pthread_mutex_consistent F GLIBC_2.38 pthread_mutex_consistent_np F GLIBC_2.38 pthread_mutex_destroy F GLIBC_2.38 pthread_mutex_getprioceiling F -GLIBC_2.38 pthread_mutex_lock F GLIBC_2.38 pthread_mutex_setprioceiling F -GLIBC_2.38 pthread_mutex_timedlock F GLIBC_2.38 pthread_mutex_transfer_np F -GLIBC_2.38 pthread_mutex_trylock F -GLIBC_2.38 pthread_mutex_unlock F GLIBC_2.38 pthread_once F GLIBC_2.38 pthread_rwlock_clockrdlock F GLIBC_2.38 pthread_rwlock_clockwrlock F