From patchwork Thu Dec 19 20:37:20 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: gfleury X-Patchwork-Id: 103462 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 0ACB23858C33 for ; Thu, 19 Dec 2024 20:40:31 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 0ACB23858C33 Authentication-Results: sourceware.org; dkim=pass (2048-bit key, secure) header.d=disroot.org header.i=@disroot.org header.a=rsa-sha256 header.s=mail header.b=AgNjLAMv X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from layka.disroot.org (layka.disroot.org [178.21.23.139]) by sourceware.org (Postfix) with ESMTPS id 3A4DC3858D21 for ; Thu, 19 Dec 2024 20:38:00 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 3A4DC3858D21 Authentication-Results: sourceware.org; dmarc=pass (p=reject dis=none) header.from=disroot.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=disroot.org ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 3A4DC3858D21 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=178.21.23.139 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1734640680; cv=none; b=mvZGl3yXH4/qVlbPvVUHby44d79l1B+0CI+8zLUQpiIqnvIfNzWaUcp+gk/96NdsGzCNNQi8HqjAuFON35R4o534NmOcRJZ2bS/QWmn0fiUmYqR9olO439dLfNwUKegSu8LwRXpkZwQ9mWAYtVYVQDfkawVGQx+MH13erGRzk8o= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1734640680; c=relaxed/simple; bh=hgmoOS4YFmPPKvENzAqyEoLVIwrfU9u/DSMc580dTho=; h=DKIM-Signature:From:To:Subject:Date:Message-Id:MIME-Version; b=nAReYLA+LShMGCd5M2BtCqH2Q4nwCQLGMbRl5XN+YYnSazHOysQv41LFYg424fe4c2oIc2ShMMFQISJxJ+95kk/rYwXVLUWGOPYLt/1PSKiOY8VNgN8mztJFaQqwDCW4mXHk8Y+bOSnU0FrQCscEW+ksNcplp0p9YS720wLDzI8= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 3A4DC3858D21 Received: from mail01.disroot.lan (localhost [127.0.0.1]) by disroot.org (Postfix) with ESMTP id 1476A24C12; Thu, 19 Dec 2024 21:37:59 +0100 (CET) X-Virus-Scanned: SPAM Filter at disroot.org Received: from layka.disroot.org ([127.0.0.1]) by localhost (disroot.org [127.0.0.1]) (amavis, port 10024) with ESMTP id TwrbPGfO6-u4; Thu, 19 Dec 2024 21:37:58 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=disroot.org; s=mail; t=1734640678; bh=hgmoOS4YFmPPKvENzAqyEoLVIwrfU9u/DSMc580dTho=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=AgNjLAMvKmP35/QVV9AMvUlZO/Jixp9T9vgS+ssKKX6yGSrkOkAwGWymciViWxxS7 EKxh2Xt64P8N7vTxzcvIDzjc6vkJRwMn3/WneZ6d2nflMFLgR1qUCdjyd9wExm40HL +SjoNB5tLk2+cpPD0wMvqcOCWu+bF39ABomjD1h4ElwWKIFYB/I80KQqt+jRbek/Jq f5/DboHUuIbza4JUNICxNadmrqLInMgRhLh/PM36mq5MmWXiaKPJ0+A1XZ91znqZZ+ eIbpI9+HzB5OhYa7isjtKJVNwnFzy7szuPw7BqSF+qiKlNCYXqiDJIGO5A7qUf0NpD nqaqboEIBDzkg== From: gfleury To: libc-alpha@sourceware.org Cc: gfleury Subject: [PATCH 1/8] htl: move pthread_cond_init into libc. Date: Thu, 19 Dec 2024 22:37:20 +0200 Message-Id: <20241219203727.669825-2-gfleury@disroot.org> In-Reply-To: <20241219203727.669825-1-gfleury@disroot.org> References: <20241219203727.669825-1-gfleury@disroot.org> MIME-Version: 1.0 X-Spam-Status: No, score=-11.8 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, SPF_HELO_NONE, SPF_PASS, TXREP 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 Signed-off-by: gfleury --- htl/Makefile | 2 +- htl/Versions | 4 +++- htl/forward.c | 3 --- htl/pt-initialize.c | 1 - sysdeps/htl/pt-cond-init.c | 8 ++++++-- sysdeps/htl/pthread-functions.h | 4 ---- sysdeps/htl/pthreadP.h | 1 + sysdeps/htl/timer_routines.c | 2 +- sysdeps/mach/hurd/i386/libc.abilist | 1 + sysdeps/mach/hurd/i386/libpthread.abilist | 1 - sysdeps/mach/hurd/x86_64/libpthread.abilist | 1 - 11 files changed, 13 insertions(+), 15 deletions(-) diff --git a/htl/Makefile b/htl/Makefile index 7f40fd91..8dee0439 100644 --- a/htl/Makefile +++ b/htl/Makefile @@ -92,7 +92,6 @@ libpthread-routines := \ pt-rwlock-timedwrlock \ pt-rwlock-unlock \ pt-cond-destroy \ - pt-cond-init \ pt-cond-brdcast \ pt-cond-signal \ pt-cond-wait \ @@ -197,6 +196,7 @@ routines := \ pt-attr-setstackaddr \ pt-attr-setstacksize \ pt-cond \ + pt-cond-init \ pt-condattr-destroy \ pt-condattr-getclock \ pt-condattr-getpshared \ diff --git a/htl/Versions b/htl/Versions index dd786f79..02d655d6 100644 --- a/htl/Versions +++ b/htl/Versions @@ -26,6 +26,7 @@ libc { pthread_attr_setscope; pthread_attr_setschedparam; pthread_attr_init; + pthread_cond_init; pthread_condattr_getclock; pthread_condattr_init; pthread_condattr_destroy; @@ -94,6 +95,7 @@ libc { __pthread_attr_setstacksize; __pthread_attr_setstackaddr; __pthread_attr_setstack; + __pthread_cond_init; __pthread_condattr_init; __pthread_default_condattr; __pthread_sigstate; @@ -133,7 +135,7 @@ libpthread { pthread_cancel; - pthread_cond_broadcast; pthread_cond_destroy; pthread_cond_init; + pthread_cond_broadcast; pthread_cond_destroy; pthread_cond_signal; pthread_cond_timedwait; pthread_cond_wait; pthread_create; pthread_detach; pthread_exit; diff --git a/htl/forward.c b/htl/forward.c index 48825de0..eb83eaed 100644 --- a/htl/forward.c +++ b/htl/forward.c @@ -55,9 +55,6 @@ name decl \ FORWARD (pthread_cond_broadcast, (pthread_cond_t *cond), (cond), 0) FORWARD (pthread_cond_destroy, (pthread_cond_t *cond), (cond), 0) -FORWARD (pthread_cond_init, - (pthread_cond_t *cond, const pthread_condattr_t *cond_attr), - (cond, cond_attr), 0) FORWARD (pthread_cond_signal, (pthread_cond_t *cond), (cond), 0) FORWARD (pthread_cond_wait, (pthread_cond_t *cond, pthread_mutex_t *mutex), (cond, mutex), 0) diff --git a/htl/pt-initialize.c b/htl/pt-initialize.c index ae721f3a..051bc09e 100644 --- a/htl/pt-initialize.c +++ b/htl/pt-initialize.c @@ -29,7 +29,6 @@ static const struct pthread_functions pthread_functions = { .ptr_pthread_cond_broadcast = __pthread_cond_broadcast, .ptr_pthread_cond_destroy = __pthread_cond_destroy, - .ptr_pthread_cond_init = __pthread_cond_init, .ptr_pthread_cond_signal = __pthread_cond_signal, .ptr_pthread_cond_wait = __pthread_cond_wait, .ptr_pthread_cond_timedwait = __pthread_cond_timedwait, diff --git a/sysdeps/htl/pt-cond-init.c b/sysdeps/htl/pt-cond-init.c index 463e42ce..73ca94e3 100644 --- a/sysdeps/htl/pt-cond-init.c +++ b/sysdeps/htl/pt-cond-init.c @@ -19,7 +19,7 @@ #include #include #include - +#include #include int @@ -43,5 +43,9 @@ __pthread_cond_init (pthread_cond_t *cond, const pthread_condattr_t * attr) *cond->__attr = *attr; return 0; } +libc_hidden_def (__pthread_cond_init) +versioned_symbol (libc, __pthread_cond_init, pthread_cond_init, GLIBC_2_21); -weak_alias (__pthread_cond_init, pthread_cond_init); +#if OTHER_SHLIB_COMPAT (libpthread, GLIBC_2_12, GLIBC_2_21) +compat_symbol (libc, __pthread_cond_init, pthread_cond_init, GLIBC_2_12); +#endif diff --git a/sysdeps/htl/pthread-functions.h b/sysdeps/htl/pthread-functions.h index 8ee01d3f..87e75ca8 100644 --- a/sysdeps/htl/pthread-functions.h +++ b/sysdeps/htl/pthread-functions.h @@ -23,8 +23,6 @@ int __pthread_cond_broadcast (pthread_cond_t *); int __pthread_cond_destroy (pthread_cond_t *); -int __pthread_cond_init (pthread_cond_t *, - const pthread_condattr_t *); int __pthread_cond_signal (pthread_cond_t *); int __pthread_cond_wait (pthread_cond_t *, pthread_mutex_t *); int __pthread_cond_timedwait (pthread_cond_t *, pthread_mutex_t *, @@ -58,8 +56,6 @@ struct pthread_functions { int (*ptr_pthread_cond_broadcast) (pthread_cond_t *); int (*ptr_pthread_cond_destroy) (pthread_cond_t *); - int (*ptr_pthread_cond_init) (pthread_cond_t *, - const pthread_condattr_t *); int (*ptr_pthread_cond_signal) (pthread_cond_t *); int (*ptr_pthread_cond_wait) (pthread_cond_t *, pthread_mutex_t *); int (*ptr_pthread_cond_timedwait) (pthread_cond_t *, pthread_mutex_t *, diff --git a/sysdeps/htl/pthreadP.h b/sysdeps/htl/pthreadP.h index adb81bc2..64c86623 100644 --- a/sysdeps/htl/pthreadP.h +++ b/sysdeps/htl/pthreadP.h @@ -43,6 +43,7 @@ extern int __pthread_mutexattr_settype (pthread_mutexattr_t *attr, int kind); extern int __pthread_cond_init (pthread_cond_t *cond, const pthread_condattr_t *cond_attr); +libc_hidden_proto (__pthread_cond_init) extern int __pthread_cond_signal (pthread_cond_t *cond); extern int __pthread_cond_broadcast (pthread_cond_t *cond); extern int __pthread_cond_wait (pthread_cond_t *cond, pthread_mutex_t *mutex); diff --git a/sysdeps/htl/timer_routines.c b/sysdeps/htl/timer_routines.c index 3a63de6b..0992ea39 100644 --- a/sysdeps/htl/timer_routines.c +++ b/sysdeps/htl/timer_routines.c @@ -151,7 +151,7 @@ thread_init (struct thread_node *thread, const pthread_attr_t *attr, clockid_t c thread->exists = 0; INIT_LIST_HEAD (&thread->timer_queue); - pthread_cond_init (&thread->cond, 0); + __pthread_cond_init (&thread->cond, 0); thread->current_timer = 0; thread->captured = pthread_self (); thread->clock_id = clock_id; diff --git a/sysdeps/mach/hurd/i386/libc.abilist b/sysdeps/mach/hurd/i386/libc.abilist index f4613aad..d5520a06 100644 --- a/sysdeps/mach/hurd/i386/libc.abilist +++ b/sysdeps/mach/hurd/i386/libc.abilist @@ -49,6 +49,7 @@ GLIBC_2.12 pthread_attr_setscope F GLIBC_2.12 pthread_attr_setstack F GLIBC_2.12 pthread_attr_setstackaddr F GLIBC_2.12 pthread_attr_setstacksize F +GLIBC_2.12 pthread_cond_init F GLIBC_2.12 pthread_condattr_destroy F GLIBC_2.12 pthread_condattr_getclock F GLIBC_2.12 pthread_condattr_getpshared F diff --git a/sysdeps/mach/hurd/i386/libpthread.abilist b/sysdeps/mach/hurd/i386/libpthread.abilist index e5b3edbe..77eddcfe 100644 --- a/sysdeps/mach/hurd/i386/libpthread.abilist +++ b/sysdeps/mach/hurd/i386/libpthread.abilist @@ -32,7 +32,6 @@ GLIBC_2.12 pthread_barrierattr_setpshared F GLIBC_2.12 pthread_cancel F GLIBC_2.12 pthread_cond_broadcast F GLIBC_2.12 pthread_cond_destroy F -GLIBC_2.12 pthread_cond_init F GLIBC_2.12 pthread_cond_signal F GLIBC_2.12 pthread_cond_timedwait F GLIBC_2.12 pthread_cond_wait F diff --git a/sysdeps/mach/hurd/x86_64/libpthread.abilist b/sysdeps/mach/hurd/x86_64/libpthread.abilist index 89a63043..25bcc9db 100644 --- a/sysdeps/mach/hurd/x86_64/libpthread.abilist +++ b/sysdeps/mach/hurd/x86_64/libpthread.abilist @@ -51,7 +51,6 @@ GLIBC_2.38 pthread_clockjoin_np F GLIBC_2.38 pthread_cond_broadcast F GLIBC_2.38 pthread_cond_clockwait F GLIBC_2.38 pthread_cond_destroy F -GLIBC_2.38 pthread_cond_init F GLIBC_2.38 pthread_cond_signal F GLIBC_2.38 pthread_cond_timedwait F GLIBC_2.38 pthread_cond_wait F From patchwork Thu Dec 19 20:37:21 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: gfleury X-Patchwork-Id: 103461 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 498593858D21 for ; Thu, 19 Dec 2024 20:40:22 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 498593858D21 Authentication-Results: sourceware.org; dkim=pass (2048-bit key, secure) header.d=disroot.org header.i=@disroot.org header.a=rsa-sha256 header.s=mail header.b=JXUDr1RL X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from layka.disroot.org (layka.disroot.org [178.21.23.139]) by sourceware.org (Postfix) with ESMTPS id 722163858D26 for ; Thu, 19 Dec 2024 20:38:01 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 722163858D26 Authentication-Results: sourceware.org; dmarc=pass (p=reject dis=none) header.from=disroot.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=disroot.org ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 722163858D26 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=178.21.23.139 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1734640681; cv=none; b=Oo1U3OTSDRuVu6T2zgm1u2+dOXy0SkJfdlD9RK+vfghhaPzDU881btRyl+h9gZA6Y1vbfPPo/2alypZrYMoVmwJFBIdIHIu+FfEjuA8mUUQrNKLkXAEnYBmZ5AHK8TO8jNX9dtEwFudYKfP2+0dEeNBSW/XBEzMypAyrjfMJvzU= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1734640681; c=relaxed/simple; bh=L7Iy6BUyOakEXtnnjjMmcopnArKGYFbtjNn0KQu5orA=; h=DKIM-Signature:From:To:Subject:Date:Message-Id:MIME-Version; b=XlPjMNjeIUbINKD6fGmOEGYWCzzmkJnbtvZ7Hpnfh7qX0PoMkDrRL99Z/KorvVwHlx2VcHUJdwbT1FjiD0iiZR9UD+I9pbN3q71HNAiBkC/nohd+U2PKH7V5PXFUGoLXqOmOtUqnNICYatzLBTNMCRqWy/TsqdnpMFy1w8ZHhjw= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 722163858D26 Received: from mail01.disroot.lan (localhost [127.0.0.1]) by disroot.org (Postfix) with ESMTP id 52EE124D30; Thu, 19 Dec 2024 21:38:00 +0100 (CET) X-Virus-Scanned: SPAM Filter at disroot.org Received: from layka.disroot.org ([127.0.0.1]) by localhost (disroot.org [127.0.0.1]) (amavis, port 10024) with ESMTP id pCmw1Vf68VId; Thu, 19 Dec 2024 21:37:59 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=disroot.org; s=mail; t=1734640679; bh=L7Iy6BUyOakEXtnnjjMmcopnArKGYFbtjNn0KQu5orA=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=JXUDr1RLwiDY7dHmTOe974OKbuDr6kyYxGziE6phlJOVVPj5ABHpTOkqyBObFKDn8 X9eYS3cdxxSk1RNtbCERnmgxxwy2FMKzv9T2nPHAutJrF6m17LOkyXzdSfElu5O7oH Vqm42WlC3j2D6N2bQMy8S0bTfK1drls3wvPudVeOqnOKObIhS8Ak8gT6qwgNXkQpAX /xk8AW5upw3z6xeIb2kYj2buQOwFoB9fTyXHlXCX/gDAhx/n84qmPKzci6l8g/uhMG 4rozr3MQrCFKc/KlhZB5/TM7MX+irgWyT9hYwszahiHH+SgBQV77YQEhiO3Exa0NCw 8C9dJydQhSUGQ== From: gfleury To: libc-alpha@sourceware.org Cc: gfleury Subject: [PATCH 2/8] htl: move __pthread_wakeup into libc. Date: Thu, 19 Dec 2024 22:37:21 +0200 Message-Id: <20241219203727.669825-3-gfleury@disroot.org> In-Reply-To: <20241219203727.669825-1-gfleury@disroot.org> References: <20241219203727.669825-1-gfleury@disroot.org> MIME-Version: 1.0 X-Spam-Status: No, score=-11.8 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, SPF_HELO_NONE, SPF_PASS, TXREP 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 Signed-off-by: gfleury --- htl/Makefile | 2 +- htl/Versions | 1 + htl/pt-internal.h | 2 +- sysdeps/mach/htl/pt-wakeup.c | 1 + 4 files changed, 4 insertions(+), 2 deletions(-) diff --git a/htl/Makefile b/htl/Makefile index 8dee0439..168b2119 100644 --- a/htl/Makefile +++ b/htl/Makefile @@ -109,7 +109,6 @@ libpthread-routines := \ pt-timedblock \ pt-block-intr \ pt-timedblock-intr \ - pt-wakeup \ pt-docancel \ pt-sysdep \ pt-setup \ @@ -211,6 +210,7 @@ routines := \ pt-sigmask \ pt-sigstate \ pt-sigstate-destroy \ + pt-wakeup \ # routines shared-only-routines = forward diff --git a/htl/Versions b/htl/Versions index 02d655d6..996626df 100644 --- a/htl/Versions +++ b/htl/Versions @@ -101,6 +101,7 @@ libc { __pthread_sigstate; __pthread_sigstate_destroy; __pthread_sigmask; + __pthread_wakeup; } } diff --git a/htl/pt-internal.h b/htl/pt-internal.h index 2b4331a6..de459d73 100644 --- a/htl/pt-internal.h +++ b/htl/pt-internal.h @@ -283,7 +283,7 @@ extern error_t __pthread_timedblock_intr (struct __pthread *__restrict thread, /* Wakeup THREAD. */ extern void __pthread_wakeup (struct __pthread *thread); - +libc_hidden_proto (__pthread_wakeup) /* Perform a cancelation. The CANCEL_LOCK member of the given thread must be locked before calling this function, which must unlock it. */ diff --git a/sysdeps/mach/htl/pt-wakeup.c b/sysdeps/mach/htl/pt-wakeup.c index c7c0c3ba..2855bcb1 100644 --- a/sysdeps/mach/htl/pt-wakeup.c +++ b/sysdeps/mach/htl/pt-wakeup.c @@ -35,3 +35,4 @@ __pthread_wakeup (struct __pthread *thread) 0, MACH_PORT_NULL); assert_perror (err); } +libc_hidden_def (__pthread_wakeup) From patchwork Thu Dec 19 20:37:22 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: gfleury X-Patchwork-Id: 103464 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 315003858D38 for ; Thu, 19 Dec 2024 20:44:28 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 315003858D38 Authentication-Results: sourceware.org; dkim=pass (2048-bit key, secure) header.d=disroot.org header.i=@disroot.org header.a=rsa-sha256 header.s=mail header.b=FcQVkp7/ X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from layka.disroot.org (layka.disroot.org [178.21.23.139]) by sourceware.org (Postfix) with ESMTPS id 750C93858C52 for ; Thu, 19 Dec 2024 20:38:07 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 750C93858C52 Authentication-Results: sourceware.org; dmarc=pass (p=reject dis=none) header.from=disroot.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=disroot.org ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 750C93858C52 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=178.21.23.139 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1734640687; cv=none; b=NiiCuwPg3xJT7pU1MBwEVmfBiJHkjY2aZ1zNGSvNmI0enoDXgYtbcA/5iROhr6O2fxreQn/9tQZVd20PY0blnekXtmnRbzG7TBEi7AUABCyDS3rt/MIoJVyDKHE58PfmJoXuM1hDZWEcq9i/oBKf6NDfKW7xr9nefELYZPsF5h8= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1734640687; c=relaxed/simple; bh=KPe0MQeUrvrLUP055y+utPjo6aMWhSN5NiF5uwsI2Qo=; h=DKIM-Signature:From:To:Subject:Date:Message-Id:MIME-Version; b=rmdiWUL2U08SJ0eiCmiJemsIbMBYhRNtgYEUGpc+Y3h1z2QrYlTd9wdzxVcCN4FO+iy+7iY7QjQp17QOdbima0pqfcj7cPcX2HFBKo5eygNOmQxFHvUDOkbQbtoT8LcccNE6J9lEo4W5nqLDs1cv0EiBN1+1B5Xnm/ENThmdzrg= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 750C93858C52 Received: from mail01.disroot.lan (localhost [127.0.0.1]) by disroot.org (Postfix) with ESMTP id 5294F24E34; Thu, 19 Dec 2024 21:38:06 +0100 (CET) X-Virus-Scanned: SPAM Filter at disroot.org Received: from layka.disroot.org ([127.0.0.1]) by localhost (disroot.org [127.0.0.1]) (amavis, port 10024) with ESMTP id EGtvpEEXOnDm; Thu, 19 Dec 2024 21:38:02 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=disroot.org; s=mail; t=1734640682; bh=KPe0MQeUrvrLUP055y+utPjo6aMWhSN5NiF5uwsI2Qo=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=FcQVkp7/1rnyp15u9xxX4VD1GZf1R7x06NuAuu7RDrMrSmBXBtO0grPF9T7YvoIux QkbmHB54o16YmgjQst0H1l2oZ2fTekuLCo2/K15aei28fmWv5eE5oCv4th9yx7qLiO BSUBM1F/dZu0szQyImt9t+Ab/1IUH9AYsmClxUup2/wq5K231ZahTRrMXbhgdZjehk d25hFzmOC8jAomakAKJT3vMGsGepxBbX/g+kP0Fz69+QNbLufwUSx34mI9zcMqlI5H xF3u3IXxIh1t2QhPMkhR+JsTK8yAbV9q3mJD9M2mJzrr324g1fgRr1KaX3Gk55+yW8 apzp/sE26Oy9Q== From: gfleury To: libc-alpha@sourceware.org Cc: gfleury Subject: [PATCH 3/8] htl: move pthread_cond_destroy into libc. Date: Thu, 19 Dec 2024 22:37:22 +0200 Message-Id: <20241219203727.669825-4-gfleury@disroot.org> In-Reply-To: <20241219203727.669825-1-gfleury@disroot.org> References: <20241219203727.669825-1-gfleury@disroot.org> MIME-Version: 1.0 X-Spam-Status: No, score=-11.8 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, SPF_HELO_NONE, SPF_PASS, TXREP 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 Signed-off-by: gfleury --- htl/Makefile | 2 +- htl/Versions | 4 +++- htl/forward.c | 1 - htl/pt-initialize.c | 1 - sysdeps/htl/pt-cond-destroy.c | 7 ++++++- sysdeps/htl/pthread-functions.h | 2 -- sysdeps/htl/pthreadP.h | 1 + sysdeps/htl/timer_routines.c | 2 +- sysdeps/mach/hurd/i386/libc.abilist | 1 + sysdeps/mach/hurd/i386/libpthread.abilist | 1 - sysdeps/mach/hurd/x86_64/libpthread.abilist | 1 - 11 files changed, 13 insertions(+), 10 deletions(-) diff --git a/htl/Makefile b/htl/Makefile index 168b2119..c61112d6 100644 --- a/htl/Makefile +++ b/htl/Makefile @@ -91,7 +91,6 @@ libpthread-routines := \ pt-rwlock-timedrdlock \ pt-rwlock-timedwrlock \ pt-rwlock-unlock \ - pt-cond-destroy \ pt-cond-brdcast \ pt-cond-signal \ pt-cond-wait \ @@ -195,6 +194,7 @@ routines := \ pt-attr-setstackaddr \ pt-attr-setstacksize \ pt-cond \ + pt-cond-destroy \ pt-cond-init \ pt-condattr-destroy \ pt-condattr-getclock \ diff --git a/htl/Versions b/htl/Versions index 996626df..30f7d03a 100644 --- a/htl/Versions +++ b/htl/Versions @@ -26,6 +26,7 @@ libc { pthread_attr_setscope; pthread_attr_setschedparam; pthread_attr_init; + pthread_cond_destroy; pthread_cond_init; pthread_condattr_getclock; pthread_condattr_init; @@ -95,6 +96,7 @@ libc { __pthread_attr_setstacksize; __pthread_attr_setstackaddr; __pthread_attr_setstack; + __pthread_cond_destroy; __pthread_cond_init; __pthread_condattr_init; __pthread_default_condattr; @@ -136,7 +138,7 @@ libpthread { pthread_cancel; - pthread_cond_broadcast; pthread_cond_destroy; + pthread_cond_broadcast; pthread_cond_signal; pthread_cond_timedwait; pthread_cond_wait; pthread_create; pthread_detach; pthread_exit; diff --git a/htl/forward.c b/htl/forward.c index eb83eaed..7731b84d 100644 --- a/htl/forward.c +++ b/htl/forward.c @@ -54,7 +54,6 @@ name decl \ FORWARD2 (name, int, decl, params, return defretval) FORWARD (pthread_cond_broadcast, (pthread_cond_t *cond), (cond), 0) -FORWARD (pthread_cond_destroy, (pthread_cond_t *cond), (cond), 0) FORWARD (pthread_cond_signal, (pthread_cond_t *cond), (cond), 0) FORWARD (pthread_cond_wait, (pthread_cond_t *cond, pthread_mutex_t *mutex), (cond, mutex), 0) diff --git a/htl/pt-initialize.c b/htl/pt-initialize.c index 051bc09e..1b147b94 100644 --- a/htl/pt-initialize.c +++ b/htl/pt-initialize.c @@ -28,7 +28,6 @@ #if IS_IN (libpthread) static const struct pthread_functions pthread_functions = { .ptr_pthread_cond_broadcast = __pthread_cond_broadcast, - .ptr_pthread_cond_destroy = __pthread_cond_destroy, .ptr_pthread_cond_signal = __pthread_cond_signal, .ptr_pthread_cond_wait = __pthread_cond_wait, .ptr_pthread_cond_timedwait = __pthread_cond_timedwait, diff --git a/sysdeps/htl/pt-cond-destroy.c b/sysdeps/htl/pt-cond-destroy.c index e3660dbb..066dd1f4 100644 --- a/sysdeps/htl/pt-cond-destroy.c +++ b/sysdeps/htl/pt-cond-destroy.c @@ -18,6 +18,7 @@ #include #include +#include int __pthread_cond_destroy (pthread_cond_t *cond) @@ -43,5 +44,9 @@ __pthread_cond_destroy (pthread_cond_t *cond) return 0; } +libc_hidden_def (__pthread_cond_destroy) +versioned_symbol (libc, __pthread_cond_destroy, pthread_cond_destroy, GLIBC_2_21); -weak_alias (__pthread_cond_destroy, pthread_cond_destroy); +#if OTHER_SHLIB_COMPAT (libpthread, GLIBC_2_12, GLIBC_2_21) +compat_symbol (libc, __pthread_cond_destroy, pthread_cond_destroy, GLIBC_2_12); +#endif diff --git a/sysdeps/htl/pthread-functions.h b/sysdeps/htl/pthread-functions.h index 87e75ca8..99510615 100644 --- a/sysdeps/htl/pthread-functions.h +++ b/sysdeps/htl/pthread-functions.h @@ -22,7 +22,6 @@ #include int __pthread_cond_broadcast (pthread_cond_t *); -int __pthread_cond_destroy (pthread_cond_t *); int __pthread_cond_signal (pthread_cond_t *); int __pthread_cond_wait (pthread_cond_t *, pthread_mutex_t *); int __pthread_cond_timedwait (pthread_cond_t *, pthread_mutex_t *, @@ -55,7 +54,6 @@ int _cthreads_ftrylockfile (FILE *); struct pthread_functions { int (*ptr_pthread_cond_broadcast) (pthread_cond_t *); - int (*ptr_pthread_cond_destroy) (pthread_cond_t *); int (*ptr_pthread_cond_signal) (pthread_cond_t *); int (*ptr_pthread_cond_wait) (pthread_cond_t *, pthread_mutex_t *); int (*ptr_pthread_cond_timedwait) (pthread_cond_t *, pthread_mutex_t *, diff --git a/sysdeps/htl/pthreadP.h b/sysdeps/htl/pthreadP.h index 64c86623..6d469b7e 100644 --- a/sysdeps/htl/pthreadP.h +++ b/sysdeps/htl/pthreadP.h @@ -56,6 +56,7 @@ extern int __pthread_cond_clockwait (pthread_cond_t *cond, const struct timespec *abstime) __nonnull ((1, 2, 4)); extern int __pthread_cond_destroy (pthread_cond_t *cond); +libc_hidden_proto (__pthread_cond_destroy); extern int __pthread_sigmask (int, const sigset_t *, sigset_t *); libc_hidden_proto (__pthread_sigmask); diff --git a/sysdeps/htl/timer_routines.c b/sysdeps/htl/timer_routines.c index 0992ea39..7e2a5613 100644 --- a/sysdeps/htl/timer_routines.c +++ b/sysdeps/htl/timer_routines.c @@ -211,7 +211,7 @@ static void thread_deinit (struct thread_node *thread) { assert (list_isempty (&thread->timer_queue)); - pthread_cond_destroy (&thread->cond); + __pthread_cond_destroy (&thread->cond); } diff --git a/sysdeps/mach/hurd/i386/libc.abilist b/sysdeps/mach/hurd/i386/libc.abilist index d5520a06..e251d09f 100644 --- a/sysdeps/mach/hurd/i386/libc.abilist +++ b/sysdeps/mach/hurd/i386/libc.abilist @@ -49,6 +49,7 @@ GLIBC_2.12 pthread_attr_setscope F GLIBC_2.12 pthread_attr_setstack F GLIBC_2.12 pthread_attr_setstackaddr F GLIBC_2.12 pthread_attr_setstacksize F +GLIBC_2.12 pthread_cond_destroy F GLIBC_2.12 pthread_cond_init F GLIBC_2.12 pthread_condattr_destroy F GLIBC_2.12 pthread_condattr_getclock F diff --git a/sysdeps/mach/hurd/i386/libpthread.abilist b/sysdeps/mach/hurd/i386/libpthread.abilist index 77eddcfe..b9d13b27 100644 --- a/sysdeps/mach/hurd/i386/libpthread.abilist +++ b/sysdeps/mach/hurd/i386/libpthread.abilist @@ -31,7 +31,6 @@ GLIBC_2.12 pthread_barrierattr_init F GLIBC_2.12 pthread_barrierattr_setpshared F GLIBC_2.12 pthread_cancel F GLIBC_2.12 pthread_cond_broadcast F -GLIBC_2.12 pthread_cond_destroy F GLIBC_2.12 pthread_cond_signal F GLIBC_2.12 pthread_cond_timedwait F GLIBC_2.12 pthread_cond_wait F diff --git a/sysdeps/mach/hurd/x86_64/libpthread.abilist b/sysdeps/mach/hurd/x86_64/libpthread.abilist index 25bcc9db..154689e8 100644 --- a/sysdeps/mach/hurd/x86_64/libpthread.abilist +++ b/sysdeps/mach/hurd/x86_64/libpthread.abilist @@ -50,7 +50,6 @@ GLIBC_2.38 pthread_cancel F GLIBC_2.38 pthread_clockjoin_np F GLIBC_2.38 pthread_cond_broadcast F GLIBC_2.38 pthread_cond_clockwait F -GLIBC_2.38 pthread_cond_destroy F GLIBC_2.38 pthread_cond_signal F GLIBC_2.38 pthread_cond_timedwait F GLIBC_2.38 pthread_cond_wait F From patchwork Thu Dec 19 20:37:23 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: gfleury X-Patchwork-Id: 103463 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 CBC853858D35 for ; Thu, 19 Dec 2024 20:41:04 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org CBC853858D35 Authentication-Results: sourceware.org; dkim=pass (2048-bit key, secure) header.d=disroot.org header.i=@disroot.org header.a=rsa-sha256 header.s=mail header.b=OkZETKz3 X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from layka.disroot.org (layka.disroot.org [178.21.23.139]) by sourceware.org (Postfix) with ESMTPS id 19F9E3858D35 for ; Thu, 19 Dec 2024 20:38:09 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 19F9E3858D35 Authentication-Results: sourceware.org; dmarc=pass (p=reject dis=none) header.from=disroot.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=disroot.org ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 19F9E3858D35 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=178.21.23.139 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1734640689; cv=none; b=Y5TUOptGUdJ0Y1VTASoWLqoudXYcAuULLv9f628J6YJzGhT74YCtqEAL0JshFQLqhi47X6XHJFYAaB/NFkzOuqoO2aL1NM2WhkMN7wyQdhnukZ8R/hya0NjkQKcbJwOKh3dNmPUANkNjXndAodN3LVZHstiqHHzoGtBT0KG8JMo= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1734640689; c=relaxed/simple; bh=JbLX+C0Dtt4qcgjWvuRl3oX8b9RJDvbIgl6E8k5q7c8=; h=DKIM-Signature:From:To:Subject:Date:Message-Id:MIME-Version; b=MUgscbzw4oFkVEoGXULAaQIIJL8krlKpS8zsNHHWjOj400Ggvt3Dv7wwVF5aXQAFt/MsasnF87g8yF7MHv/bYveMJsomwCms65Tg9HSGqvmN/XSNxdzzkWbseVsVjyHHdXFeHME4VHl6isdF1lI2NePeNR5Tfzy6j2jteCHeObQ= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 19F9E3858D35 Received: from mail01.disroot.lan (localhost [127.0.0.1]) by disroot.org (Postfix) with ESMTP id 3650524C12; Thu, 19 Dec 2024 21:38:08 +0100 (CET) X-Virus-Scanned: SPAM Filter at disroot.org Received: from layka.disroot.org ([127.0.0.1]) by localhost (disroot.org [127.0.0.1]) (amavis, port 10024) with ESMTP id XntBSm_ahoVd; Thu, 19 Dec 2024 21:38:03 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=disroot.org; s=mail; t=1734640683; bh=JbLX+C0Dtt4qcgjWvuRl3oX8b9RJDvbIgl6E8k5q7c8=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=OkZETKz3ThmxXM/IBKR7JJUtBKRTxfJXLTSdXTa0lpCFmcaW/4fwBW/8vn1t3Vfn1 CxpDSDLrHq2HXZSyO72sNz7MZGoy50zp9pVpi0w8Bd2thknazg0H80NU0kcK3mbzjP NCQ6IXero+6vt8S4jnb1BIzc9nupFYYrvti7Q3XZUULvqIQhrywvC9ix/glUjxGP0w E7K4ecwWjaSyCNzF8ynFJ6Wbp5a4fNPYjtKgu4j1wX7KijkAwtq3cTUSci6rDt/h4r 6eoiE90gspqg9tEN2EJYZfUH/vBQ2mvfCgWEgaO6aTkHNKMrr+JoCBRnr+FMh17M0d b+CPqmQmCL+0w== From: gfleury To: libc-alpha@sourceware.org Cc: gfleury Subject: [PATCH 4/8] htl: move pthread_cond_broadcast into libc. Date: Thu, 19 Dec 2024 22:37:23 +0200 Message-Id: <20241219203727.669825-5-gfleury@disroot.org> In-Reply-To: <20241219203727.669825-1-gfleury@disroot.org> References: <20241219203727.669825-1-gfleury@disroot.org> MIME-Version: 1.0 X-Spam-Status: No, score=-11.8 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, KAM_SHORT, SPF_HELO_NONE, SPF_PASS, TXREP 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 Signed-off-by: gfleury --- htl/Makefile | 2 +- htl/Versions | 3 ++- htl/forward.c | 1 - htl/pt-initialize.c | 1 - sysdeps/htl/pt-cond-brdcast.c | 8 ++++++-- sysdeps/htl/pthread-functions.h | 2 -- sysdeps/htl/pthreadP.h | 1 + sysdeps/htl/timer_routines.c | 6 +++--- sysdeps/mach/hurd/i386/libc.abilist | 1 + sysdeps/mach/hurd/i386/libpthread.abilist | 1 - sysdeps/mach/hurd/x86_64/libpthread.abilist | 1 - 11 files changed, 14 insertions(+), 13 deletions(-) diff --git a/htl/Makefile b/htl/Makefile index c61112d6..629a8a53 100644 --- a/htl/Makefile +++ b/htl/Makefile @@ -91,7 +91,6 @@ libpthread-routines := \ pt-rwlock-timedrdlock \ pt-rwlock-timedwrlock \ pt-rwlock-unlock \ - pt-cond-brdcast \ pt-cond-signal \ pt-cond-wait \ pt-cond-timedwait \ @@ -194,6 +193,7 @@ routines := \ pt-attr-setstackaddr \ pt-attr-setstacksize \ pt-cond \ + pt-cond-brdcast \ pt-cond-destroy \ pt-cond-init \ pt-condattr-destroy \ diff --git a/htl/Versions b/htl/Versions index 30f7d03a..63488001 100644 --- a/htl/Versions +++ b/htl/Versions @@ -26,6 +26,7 @@ libc { pthread_attr_setscope; pthread_attr_setschedparam; pthread_attr_init; + pthread_cond_broadcast; pthread_cond_destroy; pthread_cond_init; pthread_condattr_getclock; @@ -96,6 +97,7 @@ libc { __pthread_attr_setstacksize; __pthread_attr_setstackaddr; __pthread_attr_setstack; + __pthread_cond_broadcast; __pthread_cond_destroy; __pthread_cond_init; __pthread_condattr_init; @@ -138,7 +140,6 @@ libpthread { pthread_cancel; - pthread_cond_broadcast; pthread_cond_signal; pthread_cond_timedwait; pthread_cond_wait; pthread_create; pthread_detach; pthread_exit; diff --git a/htl/forward.c b/htl/forward.c index 7731b84d..6c83a2e7 100644 --- a/htl/forward.c +++ b/htl/forward.c @@ -53,7 +53,6 @@ name decl \ #define FORWARD(name, decl, params, defretval) \ FORWARD2 (name, int, decl, params, return defretval) -FORWARD (pthread_cond_broadcast, (pthread_cond_t *cond), (cond), 0) FORWARD (pthread_cond_signal, (pthread_cond_t *cond), (cond), 0) FORWARD (pthread_cond_wait, (pthread_cond_t *cond, pthread_mutex_t *mutex), (cond, mutex), 0) diff --git a/htl/pt-initialize.c b/htl/pt-initialize.c index 1b147b94..c0929a14 100644 --- a/htl/pt-initialize.c +++ b/htl/pt-initialize.c @@ -27,7 +27,6 @@ #if IS_IN (libpthread) static const struct pthread_functions pthread_functions = { - .ptr_pthread_cond_broadcast = __pthread_cond_broadcast, .ptr_pthread_cond_signal = __pthread_cond_signal, .ptr_pthread_cond_wait = __pthread_cond_wait, .ptr_pthread_cond_timedwait = __pthread_cond_timedwait, diff --git a/sysdeps/htl/pt-cond-brdcast.c b/sysdeps/htl/pt-cond-brdcast.c index a0071740..baa4fc5e 100644 --- a/sysdeps/htl/pt-cond-brdcast.c +++ b/sysdeps/htl/pt-cond-brdcast.c @@ -17,7 +17,7 @@ . */ #include - +#include #include /* Unblock all threads that are blocked on condition variable COND. */ @@ -40,5 +40,9 @@ __pthread_cond_broadcast (pthread_cond_t *cond) return 0; } +libc_hidden_def (__pthread_cond_broadcast) +versioned_symbol (libc, __pthread_cond_broadcast, pthread_cond_broadcast, GLIBC_2_21); -weak_alias (__pthread_cond_broadcast, pthread_cond_broadcast); +#if OTHER_SHLIB_COMPAT (libpthread, GLIBC_2_12, GLIBC_2_21) +compat_symbol (libc, __pthread_cond_broadcast, pthread_cond_broadcast, GLIBC_2_12); +#endif diff --git a/sysdeps/htl/pthread-functions.h b/sysdeps/htl/pthread-functions.h index 99510615..c09a3982 100644 --- a/sysdeps/htl/pthread-functions.h +++ b/sysdeps/htl/pthread-functions.h @@ -21,7 +21,6 @@ #include -int __pthread_cond_broadcast (pthread_cond_t *); int __pthread_cond_signal (pthread_cond_t *); int __pthread_cond_wait (pthread_cond_t *, pthread_mutex_t *); int __pthread_cond_timedwait (pthread_cond_t *, pthread_mutex_t *, @@ -53,7 +52,6 @@ int _cthreads_ftrylockfile (FILE *); so if possible avoid breaking it and append new hooks to the end. */ struct pthread_functions { - int (*ptr_pthread_cond_broadcast) (pthread_cond_t *); int (*ptr_pthread_cond_signal) (pthread_cond_t *); int (*ptr_pthread_cond_wait) (pthread_cond_t *, pthread_mutex_t *); int (*ptr_pthread_cond_timedwait) (pthread_cond_t *, pthread_mutex_t *, diff --git a/sysdeps/htl/pthreadP.h b/sysdeps/htl/pthreadP.h index 6d469b7e..4138abdd 100644 --- a/sysdeps/htl/pthreadP.h +++ b/sysdeps/htl/pthreadP.h @@ -46,6 +46,7 @@ extern int __pthread_cond_init (pthread_cond_t *cond, libc_hidden_proto (__pthread_cond_init) extern int __pthread_cond_signal (pthread_cond_t *cond); extern int __pthread_cond_broadcast (pthread_cond_t *cond); +libc_hidden_proto (__pthread_cond_broadcast); extern int __pthread_cond_wait (pthread_cond_t *cond, pthread_mutex_t *mutex); extern int __pthread_cond_timedwait (pthread_cond_t *cond, pthread_mutex_t *mutex, diff --git a/sysdeps/htl/timer_routines.c b/sysdeps/htl/timer_routines.c index 7e2a5613..1244ce86 100644 --- a/sysdeps/htl/timer_routines.c +++ b/sysdeps/htl/timer_routines.c @@ -280,7 +280,7 @@ thread_cleanup (void *val) pthread_mutex_unlock (&__timer_mutex); /* Unblock potentially blocked timer_delete(). */ - pthread_cond_broadcast (&thread->cond); + __pthread_cond_broadcast (&thread->cond); } } @@ -338,7 +338,7 @@ thread_expire_timer (struct thread_node *self, struct timer_node *timer) self->current_timer = 0; - pthread_cond_broadcast (&self->cond); + __pthread_cond_broadcast (&self->cond); } @@ -486,7 +486,7 @@ __timer_thread_start (struct thread_node *thread) void __timer_thread_wakeup (struct thread_node *thread) { - pthread_cond_broadcast (&thread->cond); + __pthread_cond_broadcast (&thread->cond); } diff --git a/sysdeps/mach/hurd/i386/libc.abilist b/sysdeps/mach/hurd/i386/libc.abilist index e251d09f..35ae6bb2 100644 --- a/sysdeps/mach/hurd/i386/libc.abilist +++ b/sysdeps/mach/hurd/i386/libc.abilist @@ -49,6 +49,7 @@ GLIBC_2.12 pthread_attr_setscope F GLIBC_2.12 pthread_attr_setstack F GLIBC_2.12 pthread_attr_setstackaddr F GLIBC_2.12 pthread_attr_setstacksize F +GLIBC_2.12 pthread_cond_broadcast F GLIBC_2.12 pthread_cond_destroy F GLIBC_2.12 pthread_cond_init F GLIBC_2.12 pthread_condattr_destroy F diff --git a/sysdeps/mach/hurd/i386/libpthread.abilist b/sysdeps/mach/hurd/i386/libpthread.abilist index b9d13b27..fd35a94f 100644 --- a/sysdeps/mach/hurd/i386/libpthread.abilist +++ b/sysdeps/mach/hurd/i386/libpthread.abilist @@ -30,7 +30,6 @@ GLIBC_2.12 pthread_barrierattr_getpshared F GLIBC_2.12 pthread_barrierattr_init F GLIBC_2.12 pthread_barrierattr_setpshared F GLIBC_2.12 pthread_cancel F -GLIBC_2.12 pthread_cond_broadcast F GLIBC_2.12 pthread_cond_signal F GLIBC_2.12 pthread_cond_timedwait F GLIBC_2.12 pthread_cond_wait F diff --git a/sysdeps/mach/hurd/x86_64/libpthread.abilist b/sysdeps/mach/hurd/x86_64/libpthread.abilist index 154689e8..1bc76cf8 100644 --- a/sysdeps/mach/hurd/x86_64/libpthread.abilist +++ b/sysdeps/mach/hurd/x86_64/libpthread.abilist @@ -48,7 +48,6 @@ GLIBC_2.38 pthread_barrierattr_init F GLIBC_2.38 pthread_barrierattr_setpshared F GLIBC_2.38 pthread_cancel F GLIBC_2.38 pthread_clockjoin_np F -GLIBC_2.38 pthread_cond_broadcast F GLIBC_2.38 pthread_cond_clockwait F GLIBC_2.38 pthread_cond_signal F GLIBC_2.38 pthread_cond_timedwait F From patchwork Thu Dec 19 20:37:24 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: gfleury X-Patchwork-Id: 103466 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 5D35C3858C98 for ; Thu, 19 Dec 2024 20:45:18 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 5D35C3858C98 Authentication-Results: sourceware.org; dkim=pass (2048-bit key, secure) header.d=disroot.org header.i=@disroot.org header.a=rsa-sha256 header.s=mail header.b=MnrZozAG X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from layka.disroot.org (layka.disroot.org [178.21.23.139]) by sourceware.org (Postfix) with ESMTPS id 6D58A3858C62 for ; Thu, 19 Dec 2024 20:38:12 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 6D58A3858C62 Authentication-Results: sourceware.org; dmarc=pass (p=reject dis=none) header.from=disroot.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=disroot.org ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 6D58A3858C62 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=178.21.23.139 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1734640692; cv=none; b=CkDHLeE7tAdEXVXDkz2rJ312lrubNHPku6My+4C8A4F54U/oBwpiegZRdwlo3luIRl7AA7s7zzX7JW3ZnkVR8hjPsBq5dfSX4wNomWEo4em2J7b+dd9iCdcBoQL2MlAI8ISfCA9kUZ4le6bRypGyT8Hwblcah6BBo3cdAJw6YKk= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1734640692; c=relaxed/simple; bh=Bi6DN+IHXohlfGLWavO2F1uYhfozdG/o3RF8/MD/VME=; h=DKIM-Signature:From:To:Subject:Date:Message-Id:MIME-Version; b=mNFisjoTEWzx3D7ux4xEVtB2ZtDIoYSxNGTButSKqiGVomvBAi2Tesp5FF8NQHYsA8tqzS5AZR1YSXs7vbyhDtq6uAKg/g85vCs97BAjrlowzuYrOAljQVDkTR7tV/mU9oG7kNC9f29x19o2eyj1Jo4Spp5lj8t+5jJHmt8/kFw= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 6D58A3858C62 Received: from mail01.disroot.lan (localhost [127.0.0.1]) by disroot.org (Postfix) with ESMTP id 6CC8E20ECC; Thu, 19 Dec 2024 21:38:11 +0100 (CET) X-Virus-Scanned: SPAM Filter at disroot.org Received: from layka.disroot.org ([127.0.0.1]) by localhost (disroot.org [127.0.0.1]) (amavis, port 10024) with ESMTP id GkJeZFHG14fU; Thu, 19 Dec 2024 21:38:07 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=disroot.org; s=mail; t=1734640685; bh=Bi6DN+IHXohlfGLWavO2F1uYhfozdG/o3RF8/MD/VME=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=MnrZozAGZVIlSoInuRUkmTCJZ/XLoECEwp/tjM8z3TijD+EaIZJFIAgoMHYPIk5jP Py2e5keR2UHtjCY/CJo0lKqxSrJJNC5nOogmiBQ3Hs+QbUjGlyEuMq6uxPOGQVY6Dq oIbUXyzkYhWJhqbbUMT8eJrWU7WFf4LPzCZtvI3sFninSH8B37qeZ1XBlDHbd7KXiP nVtKGbA0ppAnS7zYkiTb6mYE8qKiY7IJTrhFQ3z4n/ZTrmf0NVHv3gq8JtiWMRQMsZ +MljvXUd3pO8PmVyk4l0zjjujK3984fiES8s7e1IelqeJemu8+TfJ2eSNKnMI3kazC jGOQboQYo5H8g== From: gfleury To: libc-alpha@sourceware.org Cc: gfleury Subject: [PATCH 5/8] htl: move pthread_cond_signal into libc. Date: Thu, 19 Dec 2024 22:37:24 +0200 Message-Id: <20241219203727.669825-6-gfleury@disroot.org> In-Reply-To: <20241219203727.669825-1-gfleury@disroot.org> References: <20241219203727.669825-1-gfleury@disroot.org> MIME-Version: 1.0 X-Spam-Status: No, score=-11.8 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, KAM_SHORT, SPF_HELO_NONE, SPF_PASS, TXREP 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 Signed-off-by: gfleury --- htl/Makefile | 2 +- htl/Versions | 4 +++- htl/forward.c | 1 - htl/pt-initialize.c | 1 - sysdeps/htl/pt-cond-signal.c | 8 ++++++-- sysdeps/htl/pthread-functions.h | 2 -- sysdeps/htl/pthreadP.h | 1 + sysdeps/mach/hurd/i386/libc.abilist | 1 + sysdeps/mach/hurd/i386/libpthread.abilist | 1 - sysdeps/mach/hurd/x86_64/libpthread.abilist | 1 - 10 files changed, 12 insertions(+), 10 deletions(-) diff --git a/htl/Makefile b/htl/Makefile index 629a8a53..542f5ead 100644 --- a/htl/Makefile +++ b/htl/Makefile @@ -91,7 +91,6 @@ libpthread-routines := \ pt-rwlock-timedrdlock \ pt-rwlock-timedwrlock \ pt-rwlock-unlock \ - pt-cond-signal \ pt-cond-wait \ pt-cond-timedwait \ pt-hurd-cond-wait \ @@ -196,6 +195,7 @@ routines := \ pt-cond-brdcast \ pt-cond-destroy \ pt-cond-init \ + pt-cond-signal \ pt-condattr-destroy \ pt-condattr-getclock \ pt-condattr-getpshared \ diff --git a/htl/Versions b/htl/Versions index 63488001..465db496 100644 --- a/htl/Versions +++ b/htl/Versions @@ -29,6 +29,7 @@ libc { pthread_cond_broadcast; pthread_cond_destroy; pthread_cond_init; + pthread_cond_signal; pthread_condattr_getclock; pthread_condattr_init; pthread_condattr_destroy; @@ -100,6 +101,7 @@ libc { __pthread_cond_broadcast; __pthread_cond_destroy; __pthread_cond_init; + __pthread_cond_signal; __pthread_condattr_init; __pthread_default_condattr; __pthread_sigstate; @@ -140,7 +142,7 @@ libpthread { pthread_cancel; - pthread_cond_signal; pthread_cond_timedwait; pthread_cond_wait; + pthread_cond_timedwait; pthread_cond_wait; pthread_create; pthread_detach; pthread_exit; diff --git a/htl/forward.c b/htl/forward.c index 6c83a2e7..78758cef 100644 --- a/htl/forward.c +++ b/htl/forward.c @@ -53,7 +53,6 @@ name decl \ #define FORWARD(name, decl, params, defretval) \ FORWARD2 (name, int, decl, params, return defretval) -FORWARD (pthread_cond_signal, (pthread_cond_t *cond), (cond), 0) FORWARD (pthread_cond_wait, (pthread_cond_t *cond, pthread_mutex_t *mutex), (cond, mutex), 0) FORWARD (pthread_cond_timedwait, diff --git a/htl/pt-initialize.c b/htl/pt-initialize.c index c0929a14..cf312f1c 100644 --- a/htl/pt-initialize.c +++ b/htl/pt-initialize.c @@ -27,7 +27,6 @@ #if IS_IN (libpthread) static const struct pthread_functions pthread_functions = { - .ptr_pthread_cond_signal = __pthread_cond_signal, .ptr_pthread_cond_wait = __pthread_cond_wait, .ptr_pthread_cond_timedwait = __pthread_cond_timedwait, .ptr___pthread_exit = __pthread_exit, diff --git a/sysdeps/htl/pt-cond-signal.c b/sysdeps/htl/pt-cond-signal.c index 4eade037..6016abd1 100644 --- a/sysdeps/htl/pt-cond-signal.c +++ b/sysdeps/htl/pt-cond-signal.c @@ -17,7 +17,7 @@ . */ #include - +#include #include /* Unblock at least one of the threads that are blocked on condition @@ -38,5 +38,9 @@ __pthread_cond_signal (pthread_cond_t *cond) return 0; } +libc_hidden_def (__pthread_cond_signal) +versioned_symbol (libc, __pthread_cond_signal, pthread_cond_signal, GLIBC_2_21); -weak_alias (__pthread_cond_signal, pthread_cond_signal); +#if OTHER_SHLIB_COMPAT (libpthread, GLIBC_2_12, GLIBC_2_21) +compat_symbol (libc, __pthread_cond_signal, pthread_cond_signal, GLIBC_2_12); +#endif diff --git a/sysdeps/htl/pthread-functions.h b/sysdeps/htl/pthread-functions.h index c09a3982..fafefa5a 100644 --- a/sysdeps/htl/pthread-functions.h +++ b/sysdeps/htl/pthread-functions.h @@ -21,7 +21,6 @@ #include -int __pthread_cond_signal (pthread_cond_t *); int __pthread_cond_wait (pthread_cond_t *, pthread_mutex_t *); int __pthread_cond_timedwait (pthread_cond_t *, pthread_mutex_t *, const struct timespec *); @@ -52,7 +51,6 @@ int _cthreads_ftrylockfile (FILE *); so if possible avoid breaking it and append new hooks to the end. */ struct pthread_functions { - int (*ptr_pthread_cond_signal) (pthread_cond_t *); int (*ptr_pthread_cond_wait) (pthread_cond_t *, pthread_mutex_t *); int (*ptr_pthread_cond_timedwait) (pthread_cond_t *, pthread_mutex_t *, const struct timespec *); diff --git a/sysdeps/htl/pthreadP.h b/sysdeps/htl/pthreadP.h index 4138abdd..3c9f38c7 100644 --- a/sysdeps/htl/pthreadP.h +++ b/sysdeps/htl/pthreadP.h @@ -45,6 +45,7 @@ extern int __pthread_cond_init (pthread_cond_t *cond, const pthread_condattr_t *cond_attr); libc_hidden_proto (__pthread_cond_init) extern int __pthread_cond_signal (pthread_cond_t *cond); +libc_hidden_proto (__pthread_cond_signal); extern int __pthread_cond_broadcast (pthread_cond_t *cond); libc_hidden_proto (__pthread_cond_broadcast); extern int __pthread_cond_wait (pthread_cond_t *cond, pthread_mutex_t *mutex); diff --git a/sysdeps/mach/hurd/i386/libc.abilist b/sysdeps/mach/hurd/i386/libc.abilist index 35ae6bb2..e2f18b81 100644 --- a/sysdeps/mach/hurd/i386/libc.abilist +++ b/sysdeps/mach/hurd/i386/libc.abilist @@ -52,6 +52,7 @@ GLIBC_2.12 pthread_attr_setstacksize F GLIBC_2.12 pthread_cond_broadcast F GLIBC_2.12 pthread_cond_destroy F GLIBC_2.12 pthread_cond_init F +GLIBC_2.12 pthread_cond_signal F GLIBC_2.12 pthread_condattr_destroy F GLIBC_2.12 pthread_condattr_getclock F GLIBC_2.12 pthread_condattr_getpshared F diff --git a/sysdeps/mach/hurd/i386/libpthread.abilist b/sysdeps/mach/hurd/i386/libpthread.abilist index fd35a94f..7c61af5f 100644 --- a/sysdeps/mach/hurd/i386/libpthread.abilist +++ b/sysdeps/mach/hurd/i386/libpthread.abilist @@ -30,7 +30,6 @@ GLIBC_2.12 pthread_barrierattr_getpshared F GLIBC_2.12 pthread_barrierattr_init F GLIBC_2.12 pthread_barrierattr_setpshared F GLIBC_2.12 pthread_cancel F -GLIBC_2.12 pthread_cond_signal F GLIBC_2.12 pthread_cond_timedwait F GLIBC_2.12 pthread_cond_wait F GLIBC_2.12 pthread_create F diff --git a/sysdeps/mach/hurd/x86_64/libpthread.abilist b/sysdeps/mach/hurd/x86_64/libpthread.abilist index 1bc76cf8..5b2da077 100644 --- a/sysdeps/mach/hurd/x86_64/libpthread.abilist +++ b/sysdeps/mach/hurd/x86_64/libpthread.abilist @@ -49,7 +49,6 @@ GLIBC_2.38 pthread_barrierattr_setpshared F GLIBC_2.38 pthread_cancel F GLIBC_2.38 pthread_clockjoin_np F GLIBC_2.38 pthread_cond_clockwait F -GLIBC_2.38 pthread_cond_signal F GLIBC_2.38 pthread_cond_timedwait F GLIBC_2.38 pthread_cond_wait F GLIBC_2.38 pthread_create F From patchwork Thu Dec 19 20:37:25 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: gfleury X-Patchwork-Id: 103465 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 51CAD3858D35 for ; Thu, 19 Dec 2024 20:44:38 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 51CAD3858D35 Authentication-Results: sourceware.org; dkim=pass (2048-bit key, secure) header.d=disroot.org header.i=@disroot.org header.a=rsa-sha256 header.s=mail header.b=DFvNdbQL X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from layka.disroot.org (layka.disroot.org [178.21.23.139]) by sourceware.org (Postfix) with ESMTPS id 30F013858D3C for ; Thu, 19 Dec 2024 20:38:09 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 30F013858D3C Authentication-Results: sourceware.org; dmarc=pass (p=reject dis=none) header.from=disroot.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=disroot.org ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 30F013858D3C Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=178.21.23.139 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1734640689; cv=none; b=SCjZD5PDXoaSdGy+xiLhy2QXG2WjesFYYeRjdqAdgCnZNcoWuNgRC8iV6/viniVKKrhgZkCFR4AkhYE8E4p/IHNyeB/X8OwSZpWniiC3ex8Xu7T73vViWRyFI7A/O22Xam3mbwuR8teSUPJyQqtJqRpdLtXzZUN/2Rx4C1mIK1E= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1734640689; c=relaxed/simple; bh=q2vRR194HKU8PVj2eakQJFUREVCKTCrz/vmlSrWavVc=; h=DKIM-Signature:From:To:Subject:Date:Message-Id:MIME-Version; b=nlqIwz0LecrdvHzjIKkV/r8XnAXujS+HUT0z1D4EtteOLMf/gjdpxV31lMXo9BBKRy8dOR1RbWLpt1Kh/m3QBXj4KjQKA0ErE+bCrX3hcG2U7e8dQAe0CSP/J4WnfaBoV6Mj3fZcthDRS7xdbmQI6FTJqItaCFpH3aYKKjBcx00= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 30F013858D3C Received: from mail01.disroot.lan (localhost [127.0.0.1]) by disroot.org (Postfix) with ESMTP id 202052522B; Thu, 19 Dec 2024 21:38:08 +0100 (CET) X-Virus-Scanned: SPAM Filter at disroot.org Received: from layka.disroot.org ([127.0.0.1]) by localhost (disroot.org [127.0.0.1]) (amavis, port 10024) with ESMTP id gWce5D6Ro0qT; Thu, 19 Dec 2024 21:38:07 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=disroot.org; s=mail; t=1734640687; bh=q2vRR194HKU8PVj2eakQJFUREVCKTCrz/vmlSrWavVc=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=DFvNdbQLSosJLnUrrfhZfPkO0e77WY6khjK0iyI8ixkAlu0NeP3DKNFjduSSIMjZ8 8VqBZEF4ItGpCnJYhaugB6qbtWjiwrhamxpEW+JK5yCc2UglXBIyVsVF4SooUQD2FL hzu6Q4cqFr/C5SxbdK9vaTdAmrJG9W0gYM5qgdBHnHFYzeXuMV+ov1N+gL880xmagW QupAUdvXCx9AuHcPSc25/N04Uvi3VQN6afEGxSWrWp3luHmf5O/8r5F1b5pExWshMC a3H+uD6FrtH5RUWqq9Va7Ubni7ZB6z2P55c694KaCiXN3SOnQl/1PlIuoI5JiGGv7M XZALba+4CLuhA== From: gfleury To: libc-alpha@sourceware.org Cc: gfleury Subject: [PATCH 6/8] htl: move __pthread_timedblock, __pthread_timedblock_intr, __pthread_block, __pthread_block_intr into libc. Date: Thu, 19 Dec 2024 22:37:25 +0200 Message-Id: <20241219203727.669825-7-gfleury@disroot.org> In-Reply-To: <20241219203727.669825-1-gfleury@disroot.org> References: <20241219203727.669825-1-gfleury@disroot.org> MIME-Version: 1.0 X-Spam-Status: No, score=-11.8 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, SPF_HELO_NONE, SPF_PASS, TXREP 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 Signed-off-by: gfleury --- htl/Makefile | 8 ++++---- htl/Versions | 4 ++++ htl/pt-internal.h | 6 ++++-- sysdeps/mach/htl/pt-block.c | 1 + sysdeps/mach/htl/pt-timedblock.c | 1 + 5 files changed, 14 insertions(+), 6 deletions(-) diff --git a/htl/Makefile b/htl/Makefile index 542f5ead..683ca4bc 100644 --- a/htl/Makefile +++ b/htl/Makefile @@ -102,10 +102,6 @@ libpthread-routines := \ pt-startup \ pt-getconcurrency \ pt-setconcurrency \ - pt-block \ - pt-timedblock \ - pt-block-intr \ - pt-timedblock-intr \ pt-docancel \ pt-sysdep \ pt-setup \ @@ -191,6 +187,8 @@ routines := \ pt-attr-setstack \ pt-attr-setstackaddr \ pt-attr-setstacksize \ + pt-block \ + pt-block-intr \ pt-cond \ pt-cond-brdcast \ pt-cond-destroy \ @@ -210,6 +208,8 @@ routines := \ pt-sigmask \ pt-sigstate \ pt-sigstate-destroy \ + pt-timedblock \ + pt-timedblock-intr \ pt-wakeup \ # routines shared-only-routines = forward diff --git a/htl/Versions b/htl/Versions index 465db496..3fa6b936 100644 --- a/htl/Versions +++ b/htl/Versions @@ -89,6 +89,8 @@ libc { __pthread_cleanup_stack; __pthread_total; ___pthread_self; + __pthread_block; + __pthread_block_intr; __pthread_init_thread; __pthread_default_attr; __pthread_attr_init; @@ -107,6 +109,8 @@ libc { __pthread_sigstate; __pthread_sigstate_destroy; __pthread_sigmask; + __pthread_timedblock; + __pthread_timedblock_intr; __pthread_wakeup; } } diff --git a/htl/pt-internal.h b/htl/pt-internal.h index de459d73..1e4d92d0 100644 --- a/htl/pt-internal.h +++ b/htl/pt-internal.h @@ -267,20 +267,22 @@ extern void __pthread_startup (void); /* Block THREAD. */ extern void __pthread_block (struct __pthread *thread); +libc_hidden_proto (__pthread_block) /* Block THREAD until *ABSTIME is reached. */ extern error_t __pthread_timedblock (struct __pthread *__restrict thread, const struct timespec *__restrict abstime, clockid_t clock_id); - +libc_hidden_proto (__pthread_timedblock) /* Block THREAD with interrupts. */ extern error_t __pthread_block_intr (struct __pthread *thread); +libc_hidden_proto (__pthread_block_intr) /* Block THREAD until *ABSTIME is reached, with interrupts. */ extern error_t __pthread_timedblock_intr (struct __pthread *__restrict thread, const struct timespec *__restrict abstime, clockid_t clock_id); - +libc_hidden_proto (__pthread_timedblock_intr) /* Wakeup THREAD. */ extern void __pthread_wakeup (struct __pthread *thread); libc_hidden_proto (__pthread_wakeup) diff --git a/sysdeps/mach/htl/pt-block.c b/sysdeps/mach/htl/pt-block.c index 7eb2bf09..1655ef87 100644 --- a/sysdeps/mach/htl/pt-block.c +++ b/sysdeps/mach/htl/pt-block.c @@ -51,3 +51,4 @@ __pthread_block (struct __pthread *thread) assert_perror (err); RETURN(0); } +libc_hidden_def (__pthread_block) diff --git a/sysdeps/mach/htl/pt-timedblock.c b/sysdeps/mach/htl/pt-timedblock.c index da1d47e3..ddd0e031 100644 --- a/sysdeps/mach/htl/pt-timedblock.c +++ b/sysdeps/mach/htl/pt-timedblock.c @@ -69,3 +69,4 @@ __pthread_timedblock (struct __pthread *thread, assert_perror (err); return 0; } +libc_hidden_def (__pthread_timedblock) From patchwork Thu Dec 19 20:37:26 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: gfleury X-Patchwork-Id: 103469 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 5E1F23858C51 for ; Thu, 19 Dec 2024 20:49:07 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 5E1F23858C51 Authentication-Results: sourceware.org; dkim=pass (2048-bit key, secure) header.d=disroot.org header.i=@disroot.org header.a=rsa-sha256 header.s=mail header.b=M3Y4Ratr X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from layka.disroot.org (layka.disroot.org [178.21.23.139]) by sourceware.org (Postfix) with ESMTPS id B8B893858C2B for ; Thu, 19 Dec 2024 20:38:11 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org B8B893858C2B Authentication-Results: sourceware.org; dmarc=pass (p=reject dis=none) header.from=disroot.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=disroot.org ARC-Filter: OpenARC Filter v1.0.0 sourceware.org B8B893858C2B Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=178.21.23.139 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1734640692; cv=none; b=p/l/rkHCjvUoU9crHkfcAjEnHTDnkXLqdggQlwwKyJpDgtzQlBsGIMB7deL94XkZU5cvq/AsiJOkwvn3QEtFCn5JOGH7j9PAIiSsQJvkkt0NHuz7KqAFu6mZ0QLTMMLSJ3Mz5Q8HcX6sQA+ByS15yT4zl2Wrs/HWpTqwAIUAgcg= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1734640692; c=relaxed/simple; bh=64/LLV8EXPUFM2RQqvh3jed0MOVD0BFBv/WApjFEoFk=; h=DKIM-Signature:From:To:Subject:Date:Message-Id:MIME-Version; b=JfsLLHvjhnV6nQ9HT1vZy0tx9z/Tp5iGpY2ukv5UzJW5vyZJ7gQcOSrAa9boMETD4+I4LqiUhC/Tl55xsfzQXPs/MOD5edbwLM+vOafpTMzOWeW5nFHJwWEUEQvMiemhn8BiRjUW6ZjZkIhqZkJeOSX9mGubAKfe5LtXMN245HU= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org B8B893858C2B Received: from mail01.disroot.lan (localhost [127.0.0.1]) by disroot.org (Postfix) with ESMTP id A9A1624E34; Thu, 19 Dec 2024 21:38:10 +0100 (CET) X-Virus-Scanned: SPAM Filter at disroot.org Received: from layka.disroot.org ([127.0.0.1]) by localhost (disroot.org [127.0.0.1]) (amavis, port 10024) with ESMTP id cdjX-nelFPOe; Thu, 19 Dec 2024 21:38:10 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=disroot.org; s=mail; t=1734640690; bh=64/LLV8EXPUFM2RQqvh3jed0MOVD0BFBv/WApjFEoFk=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=M3Y4Ratruv/R2uiTULxDsabSOuGg1GcyNeUfddinVu7vfjoGx4tOJcsoxvo7egfCq X4HZlyYdoHwnNYba/xmkumcQVZu0SvtUU5txHVCSU/Eip2IXRCbA9x459GL0n3VmZP JaerxU+pGEY89U4sgWSISFG5A9jhI8zK2Dx59F+BW3MNLBZOd4W0PQ9VBPfvwRCIWX 7j2GAVa0IlQuscXpvjwZLnCP3BijMMMuLJGlOxaAyVKCssxq5f7p0nvpvypVYPL9+i BBwlY8stFjltwWxuVCFmgP6cs8U+MMjGLiTnSBlksZ+j1odW68g+2ldXQbhbYq6gYZ Pop2Rjqhkg+WA== From: gfleury To: libc-alpha@sourceware.org Cc: gfleury Subject: [PATCH 7/8] htl: move __pthread_mutex_checklocked into libc. Date: Thu, 19 Dec 2024 22:37:26 +0200 Message-Id: <20241219203727.669825-8-gfleury@disroot.org> In-Reply-To: <20241219203727.669825-1-gfleury@disroot.org> References: <20241219203727.669825-1-gfleury@disroot.org> MIME-Version: 1.0 X-Spam-Status: No, score=-11.9 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, SPF_HELO_NONE, SPF_PASS, TXREP 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 move out __getpid from pt-mutex.h and in pt-mutex-* include where __getpid was called Signed-off-by: gfleury --- htl/Makefile | 2 +- htl/Versions | 1 + htl/pt-internal.h | 1 + sysdeps/mach/hurd/htl/pt-mutex-checklocked.c | 2 ++ sysdeps/mach/hurd/htl/pt-mutex-consistent.c | 1 + sysdeps/mach/hurd/htl/pt-mutex-lock.c | 1 + sysdeps/mach/hurd/htl/pt-mutex-timedlock.c | 1 + sysdeps/mach/hurd/htl/pt-mutex-transfer-np.c | 1 + sysdeps/mach/hurd/htl/pt-mutex-trylock.c | 1 + sysdeps/mach/hurd/htl/pt-mutex-unlock.c | 1 + sysdeps/mach/hurd/htl/pt-mutex.h | 2 -- 11 files changed, 11 insertions(+), 3 deletions(-) diff --git a/htl/Makefile b/htl/Makefile index 683ca4bc..1c454d4d 100644 --- a/htl/Makefile +++ b/htl/Makefile @@ -68,7 +68,6 @@ libpthread-routines := \ pt-mutexattr-setrobust \ pt-mutex-init \ pt-mutex-destroy \ - pt-mutex-checklocked \ pt-mutex-lock \ pt-mutex-trylock \ pt-mutex-timedlock \ @@ -201,6 +200,7 @@ routines := \ pt-condattr-setclock \ pt-condattr-setpshared \ pt-getschedparam \ + pt-mutex-checklocked \ pt-nthreads \ pt-pthread_self \ pt-self pt-equal \ diff --git a/htl/Versions b/htl/Versions index 3fa6b936..95cf7fe4 100644 --- a/htl/Versions +++ b/htl/Versions @@ -106,6 +106,7 @@ libc { __pthread_cond_signal; __pthread_condattr_init; __pthread_default_condattr; + __pthread_mutex_checklocked; __pthread_sigstate; __pthread_sigstate_destroy; __pthread_sigmask; diff --git a/htl/pt-internal.h b/htl/pt-internal.h index 1e4d92d0..ec71fe18 100644 --- a/htl/pt-internal.h +++ b/htl/pt-internal.h @@ -319,6 +319,7 @@ libc_hidden_proto (__pthread_sigstate) /* If supported, check that MUTEX is locked by the caller. */ extern int __pthread_mutex_checklocked (pthread_mutex_t *mtx); +libc_hidden_proto (__pthread_mutex_checklocked) /* Default thread attributes. */ diff --git a/sysdeps/mach/hurd/htl/pt-mutex-checklocked.c b/sysdeps/mach/hurd/htl/pt-mutex-checklocked.c index c6afa0d3..2a3ce3c5 100644 --- a/sysdeps/mach/hurd/htl/pt-mutex-checklocked.c +++ b/sysdeps/mach/hurd/htl/pt-mutex-checklocked.c @@ -22,6 +22,7 @@ #include #include "pt-mutex.h" #include +#include int __pthread_mutex_checklocked (pthread_mutex_t *mtxp) @@ -49,3 +50,4 @@ __pthread_mutex_checklocked (pthread_mutex_t *mtxp) return ret; } +libc_hidden_def (__pthread_mutex_checklocked) diff --git a/sysdeps/mach/hurd/htl/pt-mutex-consistent.c b/sysdeps/mach/hurd/htl/pt-mutex-consistent.c index bd41eb23..56b11033 100644 --- a/sysdeps/mach/hurd/htl/pt-mutex-consistent.c +++ b/sysdeps/mach/hurd/htl/pt-mutex-consistent.c @@ -22,6 +22,7 @@ #include #include "pt-mutex.h" #include +#include int pthread_mutex_consistent (pthread_mutex_t *mtxp) diff --git a/sysdeps/mach/hurd/htl/pt-mutex-lock.c b/sysdeps/mach/hurd/htl/pt-mutex-lock.c index 3df26f43..12dae49c 100644 --- a/sysdeps/mach/hurd/htl/pt-mutex-lock.c +++ b/sysdeps/mach/hurd/htl/pt-mutex-lock.c @@ -22,6 +22,7 @@ #include #include "pt-mutex.h" #include +#include int __pthread_mutex_lock (pthread_mutex_t *mtxp) diff --git a/sysdeps/mach/hurd/htl/pt-mutex-timedlock.c b/sysdeps/mach/hurd/htl/pt-mutex-timedlock.c index 30aff2c4..11cea03d 100644 --- a/sysdeps/mach/hurd/htl/pt-mutex-timedlock.c +++ b/sysdeps/mach/hurd/htl/pt-mutex-timedlock.c @@ -22,6 +22,7 @@ #include #include "pt-mutex.h" #include +#include int __pthread_mutex_clocklock (pthread_mutex_t *mtxp, diff --git a/sysdeps/mach/hurd/htl/pt-mutex-transfer-np.c b/sysdeps/mach/hurd/htl/pt-mutex-transfer-np.c index d3aaaadd..c66a97b4 100644 --- a/sysdeps/mach/hurd/htl/pt-mutex-transfer-np.c +++ b/sysdeps/mach/hurd/htl/pt-mutex-transfer-np.c @@ -23,6 +23,7 @@ #include #include "pt-mutex.h" #include +#include int __pthread_mutex_transfer_np (pthread_mutex_t *mtxp, pthread_t th) diff --git a/sysdeps/mach/hurd/htl/pt-mutex-trylock.c b/sysdeps/mach/hurd/htl/pt-mutex-trylock.c index c232dc7a..34589459 100644 --- a/sysdeps/mach/hurd/htl/pt-mutex-trylock.c +++ b/sysdeps/mach/hurd/htl/pt-mutex-trylock.c @@ -22,6 +22,7 @@ #include #include "pt-mutex.h" #include +#include int __pthread_mutex_trylock (pthread_mutex_t *mtxp) diff --git a/sysdeps/mach/hurd/htl/pt-mutex-unlock.c b/sysdeps/mach/hurd/htl/pt-mutex-unlock.c index e85ba2c8..238728e4 100644 --- a/sysdeps/mach/hurd/htl/pt-mutex-unlock.c +++ b/sysdeps/mach/hurd/htl/pt-mutex-unlock.c @@ -22,6 +22,7 @@ #include #include "pt-mutex.h" #include +#include int __pthread_mutex_unlock (pthread_mutex_t *mtxp) diff --git a/sysdeps/mach/hurd/htl/pt-mutex.h b/sysdeps/mach/hurd/htl/pt-mutex.h index d9b7eec2..ca569447 100644 --- a/sysdeps/mach/hurd/htl/pt-mutex.h +++ b/sysdeps/mach/hurd/htl/pt-mutex.h @@ -85,6 +85,4 @@ #define MTX_TYPE(mtxp) \ ((mtxp)->__type | ((mtxp)->__flags & PTHREAD_MUTEX_ROBUST)) -extern int __getpid (void) __attribute__ ((const)); - #endif /* pt-mutex.h */ From patchwork Thu Dec 19 20:37:27 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: gfleury X-Patchwork-Id: 103467 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 226013858CD1 for ; Thu, 19 Dec 2024 20:45:38 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 226013858CD1 Authentication-Results: sourceware.org; dkim=pass (2048-bit key, secure) header.d=disroot.org header.i=@disroot.org header.a=rsa-sha256 header.s=mail header.b=LWkzId8f X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from layka.disroot.org (layka.disroot.org [178.21.23.139]) by sourceware.org (Postfix) with ESMTPS id A81813858D38 for ; Thu, 19 Dec 2024 20:38:18 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org A81813858D38 Authentication-Results: sourceware.org; dmarc=pass (p=reject dis=none) header.from=disroot.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=disroot.org ARC-Filter: OpenARC Filter v1.0.0 sourceware.org A81813858D38 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=178.21.23.139 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1734640698; cv=none; b=b6Q5qRJbhdGNJmOJ7hxNML3sl6uIVuMsR24K0LdIRpCdUELaGQO6DGt4Ue1dathX7UFwt7CAALUMaJlduuBbmUNkmm9NdQdQWmWizI+09bCfmNMBaIKNTs2gy5m+EpYHFPqpwCT4CBeNScTWhe2r4Twudt88GpWJxwo52VnJ0BQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1734640698; c=relaxed/simple; bh=Kr/WyEfD8N2fF5lEoN//cIol3Ub5uTifmGvkSxyOTJY=; h=DKIM-Signature:From:To:Subject:Date:Message-Id:MIME-Version; b=p5xf/wqCBQXL6TA9FvB7pXVABxbeicI1elZ52HugAJ8SdWhGp7tExkDd7BBbyPPt5SxGQJ8Wc1oOJFN59PyvoDLzeAdX3iEBhCY/IWkR9UvAQjHC9yzVNEvq5qe1aHJL3kAPYV+Ith7gruOSwknV1t/1qWDFd+0RtB4WRTyx4+M= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org A81813858D38 Received: from mail01.disroot.lan (localhost [127.0.0.1]) by disroot.org (Postfix) with ESMTP id C584D24C12; Thu, 19 Dec 2024 21:38:17 +0100 (CET) X-Virus-Scanned: SPAM Filter at disroot.org Received: from layka.disroot.org ([127.0.0.1]) by localhost (disroot.org [127.0.0.1]) (amavis, port 10024) with ESMTP id A8utXPsVdQIY; Thu, 19 Dec 2024 21:38:13 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=disroot.org; s=mail; t=1734640693; bh=Kr/WyEfD8N2fF5lEoN//cIol3Ub5uTifmGvkSxyOTJY=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=LWkzId8fcwJp7BkbNg9+Yy1y2TIdQTT5CEScfSnJDmP9F42RQAZd6dr9swyFxI/+f PdbgQNuDM1/KUoeX+ErUzltOnqMLwlsAxldETeq3JBMSwWK/o2e7wZjcEsOzvnG+Y1 ej18VsxDXvZFU8YFA0gTzusmAiU6KRHWYP12bS1VGf8ijlhU3aFgPMpimvUWgB7PzX 87epsABJwIdSGIUcJSrCXfA3SN0KN/vgdTBzTzbspyCQX5UNZyO9cO8aQ13IhiI5FA GC2ivVawLNmNuai1qNXSiG4S3OZJYdWCrI+/BLY230scMepFFYYh/vR3POyRLWyJ48 7p9+vKZZDwdhw== From: gfleury To: libc-alpha@sourceware.org Cc: gfleury Subject: [PATCH 8/8] htl: move pthread_cond_timedwait, pthread_cond_clockwait, pthread_cond_wait into libc. Date: Thu, 19 Dec 2024 22:37:27 +0200 Message-Id: <20241219203727.669825-9-gfleury@disroot.org> In-Reply-To: <20241219203727.669825-1-gfleury@disroot.org> References: <20241219203727.669825-1-gfleury@disroot.org> MIME-Version: 1.0 X-Spam-Status: No, score=-11.9 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, KAM_SHORT, SPF_HELO_NONE, SPF_PASS, TXREP 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 --- htl/Makefile | 4 ++-- htl/Versions | 11 +++++++---- htl/forward.c | 6 ------ htl/pt-initialize.c | 2 -- sysdeps/htl/pt-cond-timedwait.c | 11 +++++++---- sysdeps/htl/pt-cond-wait.c | 8 ++++++-- sysdeps/htl/pthread-functions.h | 6 ------ sysdeps/htl/pthreadP.h | 3 +++ sysdeps/htl/timer_routines.c | 4 ++-- sysdeps/mach/hurd/i386/libc.abilist | 3 +++ sysdeps/mach/hurd/i386/libpthread.abilist | 3 --- sysdeps/mach/hurd/x86_64/libc.abilist | 1 + sysdeps/mach/hurd/x86_64/libpthread.abilist | 3 --- 13 files changed, 31 insertions(+), 34 deletions(-) diff --git a/htl/Makefile b/htl/Makefile index 1c454d4d..8ce32d17 100644 --- a/htl/Makefile +++ b/htl/Makefile @@ -90,8 +90,6 @@ libpthread-routines := \ pt-rwlock-timedrdlock \ pt-rwlock-timedwrlock \ pt-rwlock-unlock \ - pt-cond-wait \ - pt-cond-timedwait \ pt-hurd-cond-wait \ pt-hurd-cond-timedwait \ pt-stack-alloc \ @@ -193,6 +191,8 @@ routines := \ pt-cond-destroy \ pt-cond-init \ pt-cond-signal \ + pt-cond-timedwait \ + pt-cond-wait \ pt-condattr-destroy \ pt-condattr-getclock \ pt-condattr-getpshared \ diff --git a/htl/Versions b/htl/Versions index 95cf7fe4..1492a2a1 100644 --- a/htl/Versions +++ b/htl/Versions @@ -30,6 +30,8 @@ libc { pthread_cond_destroy; pthread_cond_init; pthread_cond_signal; + pthread_cond_timedwait; + pthread_cond_wait; pthread_condattr_getclock; pthread_condattr_init; pthread_condattr_destroy; @@ -64,6 +66,8 @@ libc { # C11 thread symbols. GLIBC_2.32 { thrd_current; thrd_equal; thrd_sleep; thrd_yield; + + pthread_cond_clockwait; } GLIBC_2.41 { @@ -103,7 +107,10 @@ libc { __pthread_cond_broadcast; __pthread_cond_destroy; __pthread_cond_init; + __pthread_cond_clockwait; __pthread_cond_signal; + __pthread_cond_timedwait; + __pthread_cond_wait; __pthread_condattr_init; __pthread_default_condattr; __pthread_mutex_checklocked; @@ -147,8 +154,6 @@ libpthread { pthread_cancel; - pthread_cond_timedwait; pthread_cond_wait; - pthread_create; pthread_detach; pthread_exit; pthread_getattr_np; @@ -214,8 +219,6 @@ libpthread { cnd_broadcast; cnd_destroy; cnd_init; cnd_signal; cnd_timedwait; cnd_wait; tss_create; tss_delete; tss_get; tss_set; - pthread_cond_clockwait; - pthread_mutexattr_getrobust; pthread_mutexattr_getrobust_np; pthread_mutexattr_setrobust; pthread_mutexattr_setrobust_np; diff --git a/htl/forward.c b/htl/forward.c index 78758cef..29f55280 100644 --- a/htl/forward.c +++ b/htl/forward.c @@ -53,12 +53,6 @@ name decl \ #define FORWARD(name, decl, params, defretval) \ FORWARD2 (name, int, decl, params, return defretval) -FORWARD (pthread_cond_wait, (pthread_cond_t *cond, pthread_mutex_t *mutex), - (cond, mutex), 0) -FORWARD (pthread_cond_timedwait, - (pthread_cond_t *cond, pthread_mutex_t *mutex, - const struct timespec *abstime), (cond, mutex, abstime), 0) - /* Use an alias to avoid warning, as pthread_exit is declared noreturn. */ FORWARD_NORETURN (__pthread_exit, void, (void *retval), (retval), exit (EXIT_SUCCESS)) diff --git a/htl/pt-initialize.c b/htl/pt-initialize.c index cf312f1c..40eeb7e7 100644 --- a/htl/pt-initialize.c +++ b/htl/pt-initialize.c @@ -27,8 +27,6 @@ #if IS_IN (libpthread) static const struct pthread_functions pthread_functions = { - .ptr_pthread_cond_wait = __pthread_cond_wait, - .ptr_pthread_cond_timedwait = __pthread_cond_timedwait, .ptr___pthread_exit = __pthread_exit, .ptr_pthread_mutex_destroy = __pthread_mutex_destroy, .ptr_pthread_mutex_init = __pthread_mutex_init, diff --git a/sysdeps/htl/pt-cond-timedwait.c b/sysdeps/htl/pt-cond-timedwait.c index 78853da8..5a089a4c 100644 --- a/sysdeps/htl/pt-cond-timedwait.c +++ b/sysdeps/htl/pt-cond-timedwait.c @@ -17,7 +17,7 @@ . */ #include - +#include #include #include #include @@ -34,8 +34,12 @@ __pthread_cond_timedwait (pthread_cond_t *cond, { return __pthread_cond_timedwait_internal (cond, mutex, -1, abstime); } +libc_hidden_def (__pthread_cond_timedwait) +versioned_symbol (libc, __pthread_cond_timedwait, pthread_cond_timedwait, GLIBC_2_21); -weak_alias (__pthread_cond_timedwait, pthread_cond_timedwait); +#if OTHER_SHLIB_COMPAT (libpthread, GLIBC_2_12, GLIBC_2_21) +compat_symbol (libc, __pthread_cond_timedwait, pthread_cond_timedwait, GLIBC_2_12); +#endif int __pthread_cond_clockwait (pthread_cond_t *cond, @@ -45,8 +49,7 @@ __pthread_cond_clockwait (pthread_cond_t *cond, { return __pthread_cond_timedwait_internal (cond, mutex, clockid, abstime); } - -weak_alias (__pthread_cond_clockwait, pthread_cond_clockwait); +libc_hidden_def (__pthread_cond_clockwait) struct cancel_ctx { diff --git a/sysdeps/htl/pt-cond-wait.c b/sysdeps/htl/pt-cond-wait.c index d00547f3..850afba1 100644 --- a/sysdeps/htl/pt-cond-wait.c +++ b/sysdeps/htl/pt-cond-wait.c @@ -17,7 +17,7 @@ . */ #include - +#include #include /* Implemented in pt-cond-timedwait.c. */ @@ -35,5 +35,9 @@ __pthread_cond_wait (pthread_cond_t *cond, pthread_mutex_t *mutex) { return __pthread_cond_timedwait_internal (cond, mutex, -1, 0); } +libc_hidden_def (__pthread_cond_wait) +versioned_symbol (libc, __pthread_cond_wait, pthread_cond_wait, GLIBC_2_21); -weak_alias (__pthread_cond_wait, pthread_cond_wait); +#if OTHER_SHLIB_COMPAT (libpthread, GLIBC_2_12, GLIBC_2_21) +compat_symbol (libc, __pthread_cond_wait, pthread_cond_wait, GLIBC_2_12); +#endif diff --git a/sysdeps/htl/pthread-functions.h b/sysdeps/htl/pthread-functions.h index fafefa5a..ff93c22a 100644 --- a/sysdeps/htl/pthread-functions.h +++ b/sysdeps/htl/pthread-functions.h @@ -21,9 +21,6 @@ #include -int __pthread_cond_wait (pthread_cond_t *, pthread_mutex_t *); -int __pthread_cond_timedwait (pthread_cond_t *, pthread_mutex_t *, - const struct timespec *); void __pthread_exit (void *) __attribute__ ((__noreturn__)); int _pthread_mutex_destroy (pthread_mutex_t *); int _pthread_mutex_init (pthread_mutex_t *, @@ -51,9 +48,6 @@ int _cthreads_ftrylockfile (FILE *); so if possible avoid breaking it and append new hooks to the end. */ struct pthread_functions { - int (*ptr_pthread_cond_wait) (pthread_cond_t *, pthread_mutex_t *); - int (*ptr_pthread_cond_timedwait) (pthread_cond_t *, pthread_mutex_t *, - const struct timespec *); void (*ptr___pthread_exit) (void *) __attribute__ ((__noreturn__)); int (*ptr_pthread_mutex_destroy) (pthread_mutex_t *); int (*ptr_pthread_mutex_init) (pthread_mutex_t *, diff --git a/sysdeps/htl/pthreadP.h b/sysdeps/htl/pthreadP.h index 3c9f38c7..b5a9f0cb 100644 --- a/sysdeps/htl/pthreadP.h +++ b/sysdeps/htl/pthreadP.h @@ -49,14 +49,17 @@ libc_hidden_proto (__pthread_cond_signal); extern int __pthread_cond_broadcast (pthread_cond_t *cond); libc_hidden_proto (__pthread_cond_broadcast); extern int __pthread_cond_wait (pthread_cond_t *cond, pthread_mutex_t *mutex); +libc_hidden_proto (__pthread_cond_wait); extern int __pthread_cond_timedwait (pthread_cond_t *cond, pthread_mutex_t *mutex, const struct timespec *abstime); +libc_hidden_proto (__pthread_cond_timedwait); extern int __pthread_cond_clockwait (pthread_cond_t *cond, pthread_mutex_t *mutex, clockid_t clockid, const struct timespec *abstime) __nonnull ((1, 2, 4)); +libc_hidden_proto (__pthread_cond_clockwait); extern int __pthread_cond_destroy (pthread_cond_t *cond); libc_hidden_proto (__pthread_cond_destroy); extern int __pthread_sigmask (int, const sigset_t *, sigset_t *); diff --git a/sysdeps/htl/timer_routines.c b/sysdeps/htl/timer_routines.c index 1244ce86..4117545b 100644 --- a/sysdeps/htl/timer_routines.c +++ b/sysdeps/htl/timer_routines.c @@ -418,10 +418,10 @@ thread_func (void *arg) head of the queue must wake up the thread by broadcasting this condition variable. */ if (timer != NULL) - pthread_cond_timedwait (&self->cond, &__timer_mutex, + __pthread_cond_timedwait (&self->cond, &__timer_mutex, &timer->expirytime); else - pthread_cond_wait (&self->cond, &__timer_mutex); + __pthread_cond_wait (&self->cond, &__timer_mutex); } /* This macro will never be executed since the while loop loops forever - but we have to add it for proper nesting. */ diff --git a/sysdeps/mach/hurd/i386/libc.abilist b/sysdeps/mach/hurd/i386/libc.abilist index e2f18b81..b48fa38e 100644 --- a/sysdeps/mach/hurd/i386/libc.abilist +++ b/sysdeps/mach/hurd/i386/libc.abilist @@ -53,6 +53,8 @@ GLIBC_2.12 pthread_cond_broadcast F GLIBC_2.12 pthread_cond_destroy F GLIBC_2.12 pthread_cond_init F GLIBC_2.12 pthread_cond_signal F +GLIBC_2.12 pthread_cond_timedwait F +GLIBC_2.12 pthread_cond_wait F GLIBC_2.12 pthread_condattr_destroy F GLIBC_2.12 pthread_condattr_getclock F GLIBC_2.12 pthread_condattr_getpshared F @@ -2250,6 +2252,7 @@ GLIBC_2.30 twalk_r F 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 sigabbrev_np F GLIBC_2.32 sigdescr_np F GLIBC_2.32 strerrordesc_np F diff --git a/sysdeps/mach/hurd/i386/libpthread.abilist b/sysdeps/mach/hurd/i386/libpthread.abilist index 7c61af5f..f90794bc 100644 --- a/sysdeps/mach/hurd/i386/libpthread.abilist +++ b/sysdeps/mach/hurd/i386/libpthread.abilist @@ -30,8 +30,6 @@ GLIBC_2.12 pthread_barrierattr_getpshared F GLIBC_2.12 pthread_barrierattr_init F GLIBC_2.12 pthread_barrierattr_setpshared F GLIBC_2.12 pthread_cancel F -GLIBC_2.12 pthread_cond_timedwait F -GLIBC_2.12 pthread_cond_wait F GLIBC_2.12 pthread_create F GLIBC_2.12 pthread_detach F GLIBC_2.12 pthread_exit F @@ -119,7 +117,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_cond_clockwait F GLIBC_2.32 pthread_mutex_clocklock F GLIBC_2.32 pthread_mutex_consistent F GLIBC_2.32 pthread_mutex_consistent_np F diff --git a/sysdeps/mach/hurd/x86_64/libc.abilist b/sysdeps/mach/hurd/x86_64/libc.abilist index b331c26e..1cd5f992 100644 --- a/sysdeps/mach/hurd/x86_64/libc.abilist +++ b/sysdeps/mach/hurd/x86_64/libc.abilist @@ -1532,6 +1532,7 @@ GLIBC_2.38 pthread_attr_setstack F GLIBC_2.38 pthread_attr_setstackaddr F GLIBC_2.38 pthread_attr_setstacksize F GLIBC_2.38 pthread_cond_broadcast F +GLIBC_2.38 pthread_cond_clockwait F GLIBC_2.38 pthread_cond_destroy F GLIBC_2.38 pthread_cond_init F GLIBC_2.38 pthread_cond_signal F diff --git a/sysdeps/mach/hurd/x86_64/libpthread.abilist b/sysdeps/mach/hurd/x86_64/libpthread.abilist index 5b2da077..6262dfa8 100644 --- a/sysdeps/mach/hurd/x86_64/libpthread.abilist +++ b/sysdeps/mach/hurd/x86_64/libpthread.abilist @@ -48,9 +48,6 @@ GLIBC_2.38 pthread_barrierattr_init F GLIBC_2.38 pthread_barrierattr_setpshared F GLIBC_2.38 pthread_cancel F GLIBC_2.38 pthread_clockjoin_np F -GLIBC_2.38 pthread_cond_clockwait F -GLIBC_2.38 pthread_cond_timedwait F -GLIBC_2.38 pthread_cond_wait F GLIBC_2.38 pthread_create F GLIBC_2.38 pthread_detach F GLIBC_2.38 pthread_exit F