From patchwork Mon May 3 21:00:00 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adhemerval Zanella X-Patchwork-Id: 43237 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 5E315395445E; Mon, 3 May 2021 21:00:15 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 5E315395445E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1620075615; bh=Pkb8B8Czkg7MrwAzKza8XDEeC6ugcqBU+GerD4WiuE8=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=L7ndReijC0MGrRvdt6BWyzDmDYm/JT0qnLQAjll0yaVJUwra0zhdPZsd32G6Gqyjb pCwJBI4ZynQNU/A5RXg0IAib3KbKotV548z0hTHXd27aks9eOv5kYh292CtyV+gxQP aq7+HgLmIXxVRCGqO82Pw4S1X3wZGPvyP6j5/cAY= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-qk1-x732.google.com (mail-qk1-x732.google.com [IPv6:2607:f8b0:4864:20::732]) by sourceware.org (Postfix) with ESMTPS id 0FA76393BC37 for ; Mon, 3 May 2021 21:00:11 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 0FA76393BC37 Received: by mail-qk1-x732.google.com with SMTP id 8so6544226qkv.8 for ; Mon, 03 May 2021 14:00:11 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:mime-version :content-transfer-encoding; bh=Pkb8B8Czkg7MrwAzKza8XDEeC6ugcqBU+GerD4WiuE8=; b=GqkKgpxGvwmxNpLGni719/xY8nza0c+QN4mnKMYpbOZwSKXvTjh0LQsRECefI+bk0b 4kc0oiH14LED6VoIz2ixpInRhJlCZtXsl55pGmLakM73JKdmw135E7ijpDw/WeAWMHQZ z34ZIu6qkDpQKIPzaKCccWkwOXv2OHo/Ls3ZQpuqH0e+r2FQZzOBuvs9c76ihXiaMExu sR7cj2n77xvNJAuPvdjwl9sWT0VZPPtycxYIsUfHihHTzRpJOaJEyun433E70kpx7SHb J/q1dlnYyh4sR7WHWfau6HBCAurJYji5fD/HOVqxUyXwfJHGw1yfac83IRMcYvB1VaSY SlrA== X-Gm-Message-State: AOAM532Hij5BCwbsV5nzaPPlVMxXkdYiA2NW+lf+9EbUNN79sgbxxZ2t seD4cFf6fDnZIMeCh7wsPdlpMU7/n6jbHg== X-Google-Smtp-Source: ABdhPJzkxzSC9KkbNk47KlApPmpTwBSo6+SJ7dFeiF5rg+tk2IgqivzRrCV2RIlVMNSMNZnPiiVWmQ== X-Received: by 2002:a05:620a:2ee:: with SMTP id a14mr20886636qko.229.1620075610445; Mon, 03 May 2021 14:00:10 -0700 (PDT) Received: from birita.. ([177.194.41.149]) by smtp.googlemail.com with ESMTPSA id w196sm4578090qkb.90.2021.05.03.14.00.09 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 03 May 2021 14:00:10 -0700 (PDT) To: libc-alpha@sourceware.org Subject: [PATCH v3 1/6] nptl: Make pthread_kill async-signal-safe Date: Mon, 3 May 2021 18:00:00 -0300 Message-Id: <20210503210005.2891859-1-adhemerval.zanella@linaro.org> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 X-Spam-Status: No, score=-12.6 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Adhemerval Zanella via Libc-alpha From: Adhemerval Zanella Reply-To: Adhemerval Zanella Errors-To: libc-alpha-bounces@sourceware.org Sender: "Libc-alpha" Changes from v2: * Rebase against master. Changes from v1: * Move __libc_signal_block_all prior TID read. --- Simiar to raise (BZ #15368), pthread_kill is also defined as async-signal-safe (POSIX.1-2008 TC1). However, similar to raise it has the same issues relating to signal handling. Different than raise, all the signal are blocked so it would be possible to implement pthread_cancel (which also should be async-cancel safe). Checked on x86_64-linux-gnu. --- nptl/pthread_kill.c | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/nptl/pthread_kill.c b/nptl/pthread_kill.c index ad7e011779..71c362adce 100644 --- a/nptl/pthread_kill.c +++ b/nptl/pthread_kill.c @@ -28,6 +28,11 @@ __pthread_kill (pthread_t threadid, int signo) if (__is_internal_signal (signo)) return EINVAL; + sigset_t set; + __libc_signal_block_all (&set); + + int val; + /* Force load of pd->tid into local variable or register. Otherwise if a thread exits between ESRCH test and tgkill, we might return EINVAL, because pd->tid would be cleared by the kernel. */ @@ -35,14 +40,20 @@ __pthread_kill (pthread_t threadid, int signo) pid_t tid = atomic_forced_read (pd->tid); if (__glibc_unlikely (tid <= 0)) /* Not a valid thread handle. */ - return ESRCH; + val = ESRCH; + else + { + /* We have a special syscall to do the work. */ + pid_t pid = __getpid (); + + val = INTERNAL_SYSCALL_CALL (tgkill, pid, tid, signo); + val = (INTERNAL_SYSCALL_ERROR_P (val) + ? INTERNAL_SYSCALL_ERRNO (val) : 0); + } - /* We have a special syscall to do the work. */ - pid_t pid = __getpid (); + __libc_signal_restore_set (&set); - int val = INTERNAL_SYSCALL_CALL (tgkill, pid, tid, signo); - return (INTERNAL_SYSCALL_ERROR_P (val) - ? INTERNAL_SYSCALL_ERRNO (val) : 0); + return val; } versioned_symbol (libc, __pthread_kill, pthread_kill, GLIBC_2_34); From patchwork Mon May 3 21:00:01 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adhemerval Zanella X-Patchwork-Id: 43238 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 F04F43957413; Mon, 3 May 2021 21:00:15 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org F04F43957413 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1620075616; bh=tEdH7x1qAyEGypnS0tKN+2tPi+tCqd1R0CJYBYL+t4A=; h=To:Subject:Date:In-Reply-To:References:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=RfuvwsptHl0eexsiCO79M7B7j9slLjkdwUdOCpDiqOlYPR68oi8Vb6j9rIGk+mpiJ xCz+Lfc2lIgfxlT/yG6wPvrBR5xG5Ah1OQwk/EQVs19xOrd4XsVjR98iiZBatoLf6S Sqky1BoXnXISQOaecXgngx/vjRMa9mABYA55gNUc= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-qk1-x72e.google.com (mail-qk1-x72e.google.com [IPv6:2607:f8b0:4864:20::72e]) by sourceware.org (Postfix) with ESMTPS id 8941A3950406 for ; Mon, 3 May 2021 21:00:12 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 8941A3950406 Received: by mail-qk1-x72e.google.com with SMTP id a2so6547495qkh.11 for ; Mon, 03 May 2021 14:00:12 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=tEdH7x1qAyEGypnS0tKN+2tPi+tCqd1R0CJYBYL+t4A=; b=fGONomoN1kZe0e+IANMurmMeSAC6rR/QAXT7ZZ8SY/EyC/BTYNTIgOHANZj44U7hV0 9ykLHqWBdveXoYOMuweH4jrw2Ax9ibJrVmKl/cqv1k53YAS5FEdJjmKmtbeu7F0SLwpV 3gLK4KyoN9+++FEQTbdy49rJSe+srN3x1a2tYPpTANAW1YpOi8oCg2JDkSW1tajIZdqs Jwq6A8grg8dpAea319loy8J9igL0K0lCl1TqDNPC6Yi9DmoMKGKoLtfLJZ+EnKc+icTY jNmwDjawvk+X3NyzC/nWPyTj2g7XdKUXp1INsFVqaMmdyaKA99bWfvYR49maqvnnooX/ gh6Q== X-Gm-Message-State: AOAM532qSjwDiyJWs+9ywok4fHabVskJLpSbmyzIWyfFO9LauqAC29P+ qwqhkeWo7OL2ww/GttpS4P1gaL33ZPn2KQ== X-Google-Smtp-Source: ABdhPJxL5PoDdxmwE+HSkWsxRfclas1D96OfoIWC5/jMu0H98L2SFRueEwYAehrumF9NliFXozVjog== X-Received: by 2002:a37:46c5:: with SMTP id t188mr21901871qka.47.1620075611732; Mon, 03 May 2021 14:00:11 -0700 (PDT) Received: from birita.. ([177.194.41.149]) by smtp.googlemail.com with ESMTPSA id w196sm4578090qkb.90.2021.05.03.14.00.10 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 03 May 2021 14:00:11 -0700 (PDT) To: libc-alpha@sourceware.org Subject: [PATCH v3 2/6] nptl: Implement raise in terms of pthread_kill Date: Mon, 3 May 2021 18:00:01 -0300 Message-Id: <20210503210005.2891859-2-adhemerval.zanella@linaro.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210503210005.2891859-1-adhemerval.zanella@linaro.org> References: <20210503210005.2891859-1-adhemerval.zanella@linaro.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, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP, URIBL_BLACK autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Adhemerval Zanella via Libc-alpha From: Adhemerval Zanella Reply-To: Adhemerval Zanella Errors-To: libc-alpha-bounces@sourceware.org Sender: "Libc-alpha" Changes from v2: * Rebase against master. * Do not added the versioned symbol for rtld. Changes from v1: * Handle vfork usage for raise and obtain the TID using a syscall instead of reading from TCB. --- Now that pthread_kill is provided by libc.so and async-signal-safe, it is possible to implement the generic POSIX implementation as pthread_kill(pthread_self(), sig). For Linux implementation, pthread_kill read the targetting TID from the TCB. For raise, this it not possible because it would make raise fail when issue after vfork (where creates the resulting process has a different TID from the parent, but its TCB is not updated as for pthread_create). For this case, gettid is called directly. Checked on x86_64-linux-gnu. --- include/pthread.h | 5 ++++ nptl/pthreadP.h | 4 +-- nptl/pthread_kill.c | 42 +++++++++++++++----------- nptl/pthread_self.c | 4 ++- sysdeps/htl/pthreadP.h | 2 -- sysdeps/posix/raise.c | 11 +++++-- sysdeps/unix/sysv/linux/raise.c | 52 --------------------------------- 7 files changed, 44 insertions(+), 76 deletions(-) delete mode 100644 sysdeps/unix/sysv/linux/raise.c diff --git a/include/pthread.h b/include/pthread.h index 858c869a16..2623fb5e95 100644 --- a/include/pthread.h +++ b/include/pthread.h @@ -13,4 +13,9 @@ extern int __pthread_barrier_wait (pthread_barrier_t *__barrier) /* This function is called to initialize the pthread library. */ extern void __pthread_initialize (void) __attribute__ ((weak)); + +extern int __pthread_kill (pthread_t threadid, int signo); + +extern pthread_t __pthread_self (void); + #endif diff --git a/nptl/pthreadP.h b/nptl/pthreadP.h index 00d2cfe764..3e5aba74ed 100644 --- a/nptl/pthreadP.h +++ b/nptl/pthreadP.h @@ -559,11 +559,11 @@ extern int __pthread_once (pthread_once_t *once_control, libc_hidden_proto (__pthread_once) extern int __pthread_atfork (void (*prepare) (void), void (*parent) (void), void (*child) (void)); -extern pthread_t __pthread_self (void); +libc_hidden_proto (__pthread_self) extern int __pthread_equal (pthread_t thread1, pthread_t thread2); extern int __pthread_detach (pthread_t th); extern int __pthread_cancel (pthread_t th); -extern int __pthread_kill (pthread_t threadid, int signo); +libc_hidden_proto (__pthread_kill) extern void __pthread_exit (void *value) __attribute__ ((__noreturn__)); libc_hidden_proto (__pthread_exit) extern int __pthread_join (pthread_t threadid, void **thread_return); diff --git a/nptl/pthread_kill.c b/nptl/pthread_kill.c index 71c362adce..d79531c10c 100644 --- a/nptl/pthread_kill.c +++ b/nptl/pthread_kill.c @@ -31,32 +31,40 @@ __pthread_kill (pthread_t threadid, int signo) sigset_t set; __libc_signal_block_all (&set); - int val; - - /* Force load of pd->tid into local variable or register. Otherwise - if a thread exits between ESRCH test and tgkill, we might return - EINVAL, because pd->tid would be cleared by the kernel. */ + pid_t tid; struct pthread *pd = (struct pthread *) threadid; - pid_t tid = atomic_forced_read (pd->tid); - if (__glibc_unlikely (tid <= 0)) - /* Not a valid thread handle. */ - val = ESRCH; + + if (pd == THREAD_SELF) + tid = INLINE_SYSCALL_CALL (gettid); else - { - /* We have a special syscall to do the work. */ - pid_t pid = __getpid (); + /* Force load of pd->tid into local variable or register. Otherwise + if a thread exits between ESRCH test and tgkill, we might return + EINVAL, because pd->tid would be cleared by the kernel. */ + tid = atomic_forced_read (pd->tid); + + int val; + if (__glibc_likely (tid > 0)) + { + pid_t pid = __getpid (); - val = INTERNAL_SYSCALL_CALL (tgkill, pid, tid, signo); - val = (INTERNAL_SYSCALL_ERROR_P (val) - ? INTERNAL_SYSCALL_ERRNO (val) : 0); - } + val = INTERNAL_SYSCALL_CALL (tgkill, pid, tid, signo); + val = (INTERNAL_SYSCALL_ERROR_P (val) + ? INTERNAL_SYSCALL_ERRNO (val) : 0); + } + else + val = ESRCH; __libc_signal_restore_set (&set); return val; } +/* Some architectures (for instance arm) might pull raise through libgcc, so + avoid the symbol version if it ends up being used on ld.so. */ +#if !IS_IN(rtld) +libc_hidden_def (__pthread_kill) versioned_symbol (libc, __pthread_kill, pthread_kill, GLIBC_2_34); -#if OTHER_SHLIB_COMPAT (libpthread, GLIBC_2_0, GLIBC_2_34) +# if OTHER_SHLIB_COMPAT (libpthread, GLIBC_2_0, GLIBC_2_34) compat_symbol (libc, __pthread_kill, pthread_kill, GLIBC_2_0); +# endif #endif diff --git a/nptl/pthread_self.c b/nptl/pthread_self.c index f877a2e6bd..196d93fb8e 100644 --- a/nptl/pthread_self.c +++ b/nptl/pthread_self.c @@ -20,7 +20,9 @@ #include pthread_t -pthread_self (void) +__pthread_self (void) { return (pthread_t) THREAD_SELF; } +libc_hidden_def (__pthread_self) +weak_alias (__pthread_self, pthread_self) diff --git a/sysdeps/htl/pthreadP.h b/sysdeps/htl/pthreadP.h index 8e2cf2ce65..3b357b7bdc 100644 --- a/sysdeps/htl/pthreadP.h +++ b/sysdeps/htl/pthreadP.h @@ -31,8 +31,6 @@ extern void __pthread_init_static_tls (struct link_map *) attribute_hidden; /* These represent the interface used by glibc itself. */ -extern pthread_t __pthread_self (void); -extern int __pthread_kill (pthread_t threadid, int signo); extern struct __pthread **__pthread_threads; extern int __pthread_mutex_init (pthread_mutex_t *__mutex, const pthread_mutexattr_t *__attr); diff --git a/sysdeps/posix/raise.c b/sysdeps/posix/raise.c index 9fdb4d538b..4806c0cc63 100644 --- a/sysdeps/posix/raise.c +++ b/sysdeps/posix/raise.c @@ -16,13 +16,20 @@ . */ #include -#include +#include +#include /* Raise the signal SIG. */ int raise (int sig) { - return __kill (__getpid (), sig); + int ret = __pthread_kill (__pthread_self (), sig); + if (ret != 0) + { + __set_errno (ret); + ret = -1; + } + return ret; } libc_hidden_def (raise) weak_alias (raise, gsignal) diff --git a/sysdeps/unix/sysv/linux/raise.c b/sysdeps/unix/sysv/linux/raise.c deleted file mode 100644 index 9be3b37f53..0000000000 --- a/sysdeps/unix/sysv/linux/raise.c +++ /dev/null @@ -1,52 +0,0 @@ -/* Copyright (C) 2002-2021 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Ulrich Drepper , 2002. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, see - . */ - -#include -#include -#include -#include -#include -#include - -int -raise (int sig) -{ - /* rt_sigprocmask may fail if: - - 1. sigsetsize != sizeof (sigset_t) (EINVAL) - 2. a failure in copy from/to user space (EFAULT) - 3. an invalid 'how' operation (EINVAL) - - The first case is already handle in glibc syscall call by using the arch - defined _NSIG. Second case is handled by using a stack allocated mask. - The last one should be handled by the block/unblock functions. */ - - sigset_t set; - __libc_signal_block_app (&set); - - pid_t pid = INTERNAL_SYSCALL_CALL (getpid); - pid_t tid = INTERNAL_SYSCALL_CALL (gettid); - - int ret = INLINE_SYSCALL_CALL (tgkill, pid, tid, sig); - - __libc_signal_restore_set (&set); - - return ret; -} -libc_hidden_def (raise) -weak_alias (raise, gsignal) From patchwork Mon May 3 21:00:02 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adhemerval Zanella X-Patchwork-Id: 43241 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 6DC593957425; Mon, 3 May 2021 21:00:22 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 6DC593957425 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1620075622; bh=zc4V+OzofFLwQGiTEkbxrDeO/0ta/gcrLNwDGKErePE=; h=To:Subject:Date:In-Reply-To:References:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=RS3d9dFiwm67o8knbUKEcCjE/OXXE4swy4Z0km/w/LTy3BnxgOBDA/bPNFkuS2arQ KIrBi7teh3gbEmvj4z9DM/atms2z3RFNX/bUbmQP8tEFJXtI7+DtqF8pY4Ee3ZV8/s e5sZi6LXONQeuasdvfDaR+Fa9QPWjX1d8Ue2gipk= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-qk1-x731.google.com (mail-qk1-x731.google.com [IPv6:2607:f8b0:4864:20::731]) by sourceware.org (Postfix) with ESMTPS id C2A4D393BC37 for ; Mon, 3 May 2021 21:00:14 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org C2A4D393BC37 Received: by mail-qk1-x731.google.com with SMTP id 76so4737512qkn.13 for ; Mon, 03 May 2021 14:00:14 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=zc4V+OzofFLwQGiTEkbxrDeO/0ta/gcrLNwDGKErePE=; b=AatpdZTyUy56C9eHSG1p3nCD/jdxmu+oYr732YaQ/IAiSKkolVo2sPs7kMmCxm04cT vLUiN0HcYPd4kK08k93QLrB/sSHumcfXk1TFVRdZ5uyAwmeq/v9OdqIlqL78okVJEoY7 5Xyt1bDBvKY6Z1fKVkKqGs1DzIgGa2x8TCp6/S5S+hXxlhriYScPb8wyqOnXR06aQ4eZ bun5C6SAmempTWmdUOTTaFwbVU/NVAohwEL2SIa0WAQe4aNhy8f/AuW8I/KTQLq8hVWZ fevVDsc5vHVr8TAvdhFO5Yf+Izt2aqeP9twdtCqm3SX9Tgcu0VohsbXQJgyysPZBhfp8 c9tA== X-Gm-Message-State: AOAM5303VP5JaNp0othBUtZAs89fZpyfrikWt/ck0oClX2vR4EGQUXpv dFoUdVq6HYh/h+9u+1EYJHi81/pApumosA== X-Google-Smtp-Source: ABdhPJy9SL4nVz7ytt59FL0ZK+Ob0wYZxQOFK1yhlBZ2uGyAZ6CW2uCg6jkAFWlSdTT8X/WlFxXIZA== X-Received: by 2002:a05:620a:4515:: with SMTP id t21mr5361133qkp.442.1620075613208; Mon, 03 May 2021 14:00:13 -0700 (PDT) Received: from birita.. ([177.194.41.149]) by smtp.googlemail.com with ESMTPSA id w196sm4578090qkb.90.2021.05.03.14.00.12 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 03 May 2021 14:00:12 -0700 (PDT) To: libc-alpha@sourceware.org Subject: [PATCH v3 3/6] nptl: Move pthread_testcancel into libc Date: Mon, 3 May 2021 18:00:02 -0300 Message-Id: <20210503210005.2891859-3-adhemerval.zanella@linaro.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210503210005.2891859-1-adhemerval.zanella@linaro.org> References: <20210503210005.2891859-1-adhemerval.zanella@linaro.org> MIME-Version: 1.0 X-Spam-Status: No, score=-12.6 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Adhemerval Zanella via Libc-alpha From: Adhemerval Zanella Reply-To: Adhemerval Zanella Errors-To: libc-alpha-bounces@sourceware.org Sender: "Libc-alpha" It is added on GLIBC_PRIVATE since libpthread uses it. The symbol was moved using scripts/move-symbol-to-libc.py. --- nptl/Makefile | 2 +- nptl/Versions | 6 ++++-- nptl/pthreadP.h | 2 +- nptl/pthread_testcancel.c | 10 ++++++++-- sysdeps/unix/sysv/linux/aarch64/libc.abilist | 2 ++ sysdeps/unix/sysv/linux/aarch64/libpthread.abilist | 1 - sysdeps/unix/sysv/linux/alpha/libc.abilist | 2 ++ sysdeps/unix/sysv/linux/alpha/libpthread.abilist | 1 - sysdeps/unix/sysv/linux/arc/libc.abilist | 2 ++ sysdeps/unix/sysv/linux/arc/libpthread.abilist | 1 - sysdeps/unix/sysv/linux/arm/be/libc.abilist | 2 ++ sysdeps/unix/sysv/linux/arm/be/libpthread.abilist | 1 - sysdeps/unix/sysv/linux/arm/le/libc.abilist | 2 ++ sysdeps/unix/sysv/linux/arm/le/libpthread.abilist | 1 - sysdeps/unix/sysv/linux/csky/libc.abilist | 2 ++ sysdeps/unix/sysv/linux/csky/libpthread.abilist | 1 - sysdeps/unix/sysv/linux/hppa/libc.abilist | 2 ++ sysdeps/unix/sysv/linux/hppa/libpthread.abilist | 1 - sysdeps/unix/sysv/linux/i386/libc.abilist | 2 ++ sysdeps/unix/sysv/linux/i386/libpthread.abilist | 1 - sysdeps/unix/sysv/linux/ia64/libc.abilist | 2 ++ sysdeps/unix/sysv/linux/ia64/libpthread.abilist | 1 - sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist | 2 ++ .../unix/sysv/linux/m68k/coldfire/libpthread.abilist | 1 - sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist | 2 ++ sysdeps/unix/sysv/linux/m68k/m680x0/libpthread.abilist | 1 - sysdeps/unix/sysv/linux/microblaze/be/libc.abilist | 2 ++ .../unix/sysv/linux/microblaze/be/libpthread.abilist | 1 - sysdeps/unix/sysv/linux/microblaze/le/libc.abilist | 2 ++ .../unix/sysv/linux/microblaze/le/libpthread.abilist | 1 - sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist | 2 ++ sysdeps/unix/sysv/linux/mips/mips32/libpthread.abilist | 1 - sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist | 2 ++ sysdeps/unix/sysv/linux/mips/mips64/libpthread.abilist | 1 - sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist | 2 ++ sysdeps/unix/sysv/linux/mips/mips64/n64/libc.abilist | 2 ++ sysdeps/unix/sysv/linux/nios2/libc.abilist | 2 ++ sysdeps/unix/sysv/linux/nios2/libpthread.abilist | 1 - .../unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist | 2 ++ .../sysv/linux/powerpc/powerpc32/libpthread.abilist | 1 - .../sysv/linux/powerpc/powerpc32/nofpu/libc.abilist | 2 ++ .../unix/sysv/linux/powerpc/powerpc64/be/libc.abilist | 2 ++ .../sysv/linux/powerpc/powerpc64/be/libpthread.abilist | 1 - .../unix/sysv/linux/powerpc/powerpc64/le/libc.abilist | 2 ++ .../sysv/linux/powerpc/powerpc64/le/libpthread.abilist | 1 - sysdeps/unix/sysv/linux/riscv/rv32/libc.abilist | 2 ++ sysdeps/unix/sysv/linux/riscv/rv32/libpthread.abilist | 1 - sysdeps/unix/sysv/linux/riscv/rv64/libc.abilist | 2 ++ sysdeps/unix/sysv/linux/riscv/rv64/libpthread.abilist | 1 - sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist | 2 ++ .../unix/sysv/linux/s390/s390-32/libpthread.abilist | 1 - sysdeps/unix/sysv/linux/s390/s390-64/libc.abilist | 2 ++ .../unix/sysv/linux/s390/s390-64/libpthread.abilist | 1 - sysdeps/unix/sysv/linux/sh/be/libc.abilist | 2 ++ sysdeps/unix/sysv/linux/sh/be/libpthread.abilist | 1 - sysdeps/unix/sysv/linux/sh/le/libc.abilist | 2 ++ sysdeps/unix/sysv/linux/sh/le/libpthread.abilist | 1 - sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist | 2 ++ .../unix/sysv/linux/sparc/sparc32/libpthread.abilist | 1 - sysdeps/unix/sysv/linux/sparc/sparc64/libc.abilist | 2 ++ .../unix/sysv/linux/sparc/sparc64/libpthread.abilist | 1 - sysdeps/unix/sysv/linux/x86_64/64/libc.abilist | 2 ++ sysdeps/unix/sysv/linux/x86_64/64/libpthread.abilist | 1 - sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist | 2 ++ sysdeps/unix/sysv/linux/x86_64/x32/libpthread.abilist | 1 - 65 files changed, 78 insertions(+), 35 deletions(-) diff --git a/nptl/Makefile b/nptl/Makefile index 38f2715c2c..884cb69bb4 100644 --- a/nptl/Makefile +++ b/nptl/Makefile @@ -148,6 +148,7 @@ routines = \ pthread_spin_lock \ pthread_spin_trylock \ pthread_spin_unlock \ + pthread_testcancel \ pthread_yield \ tpp \ unwind \ @@ -199,7 +200,6 @@ libpthread-routines = \ pthread_setname \ pthread_setschedprio \ pthread_sigqueue \ - pthread_testcancel \ pthread_timedjoin \ pthread_tryjoin \ sem_clockwait \ diff --git a/nptl/Versions b/nptl/Versions index 0914630be3..b0c575e30f 100644 --- a/nptl/Versions +++ b/nptl/Versions @@ -61,6 +61,7 @@ libc { pthread_setschedparam; pthread_setspecific; pthread_sigmask; + pthread_testcancel; } GLIBC_2.1 { pthread_attr_init; @@ -245,6 +246,7 @@ libc { pthread_spin_lock; pthread_spin_trylock; pthread_spin_unlock; + pthread_testcancel; thrd_exit; tss_create; tss_delete; @@ -286,6 +288,7 @@ libc { __pthread_setcancelstate; __pthread_tpp_change_priority; __pthread_unwind; + __pthread_testcancel; __sched_fifo_max_prio; __sched_fifo_min_prio; } @@ -307,7 +310,6 @@ libpthread { pthread_detach; pthread_join; pthread_sigmask; - pthread_testcancel; sem_destroy; sem_getvalue; sem_init; @@ -439,4 +441,4 @@ ld { GLIBC_PRIVATE { __nptl_set_robust_list_avail; } -} \ No newline at end of file +} diff --git a/nptl/pthreadP.h b/nptl/pthreadP.h index 3e5aba74ed..4116970b77 100644 --- a/nptl/pthreadP.h +++ b/nptl/pthreadP.h @@ -572,6 +572,7 @@ libc_hidden_proto (__pthread_setcanceltype) extern int __pthread_enable_asynccancel (void) attribute_hidden; extern void __pthread_disable_asynccancel (int oldtype) attribute_hidden; extern void __pthread_testcancel (void); +libc_hidden_proto (__pthread_testcancel) extern int __pthread_clockjoin_ex (pthread_t, void **, clockid_t, const struct __timespec64 *, bool) attribute_hidden; @@ -581,7 +582,6 @@ libc_hidden_proto (__pthread_sigmask); #if IS_IN (libpthread) hidden_proto (__pthread_rwlock_unlock) -hidden_proto (__pthread_testcancel) #endif extern int __pthread_cond_broadcast_2_0 (pthread_cond_2_0_t *cond); diff --git a/nptl/pthread_testcancel.c b/nptl/pthread_testcancel.c index 8ed2370afa..b6964904bb 100644 --- a/nptl/pthread_testcancel.c +++ b/nptl/pthread_testcancel.c @@ -18,6 +18,7 @@ #include #include "pthreadP.h" +#include void @@ -25,5 +26,10 @@ __pthread_testcancel (void) { CANCELLATION_P (THREAD_SELF); } -strong_alias (__pthread_testcancel, pthread_testcancel) -hidden_def (__pthread_testcancel) +libc_hidden_def (__pthread_testcancel) + +versioned_symbol (libc, __pthread_testcancel, pthread_testcancel, GLIBC_2_34); + +#if OTHER_SHLIB_COMPAT (libpthread, GLIBC_2_0, GLIBC_2_34) +compat_symbol (libpthread, __pthread_testcancel, pthread_testcancel, GLIBC_2_0); +#endif diff --git a/sysdeps/unix/sysv/linux/aarch64/libc.abilist b/sysdeps/unix/sysv/linux/aarch64/libc.abilist index 29094366e3..3c79f614cf 100644 --- a/sysdeps/unix/sysv/linux/aarch64/libc.abilist +++ b/sysdeps/unix/sysv/linux/aarch64/libc.abilist @@ -1530,6 +1530,7 @@ GLIBC_2.17 pthread_spin_init F GLIBC_2.17 pthread_spin_lock F GLIBC_2.17 pthread_spin_trylock F GLIBC_2.17 pthread_spin_unlock F +GLIBC_2.17 pthread_testcancel F GLIBC_2.17 pthread_yield F GLIBC_2.17 ptrace F GLIBC_2.17 ptsname F @@ -2344,6 +2345,7 @@ GLIBC_2.34 pthread_spin_init F GLIBC_2.34 pthread_spin_lock F GLIBC_2.34 pthread_spin_trylock F GLIBC_2.34 pthread_spin_unlock F +GLIBC_2.34 pthread_testcancel F GLIBC_2.34 thrd_exit F GLIBC_2.34 tss_create F GLIBC_2.34 tss_delete F diff --git a/sysdeps/unix/sysv/linux/aarch64/libpthread.abilist b/sysdeps/unix/sysv/linux/aarch64/libpthread.abilist index c1f11e12df..839f2ff64a 100644 --- a/sysdeps/unix/sysv/linux/aarch64/libpthread.abilist +++ b/sysdeps/unix/sysv/linux/aarch64/libpthread.abilist @@ -37,7 +37,6 @@ GLIBC_2.17 pthread_setconcurrency F GLIBC_2.17 pthread_setname_np F GLIBC_2.17 pthread_setschedprio F GLIBC_2.17 pthread_sigqueue F -GLIBC_2.17 pthread_testcancel F GLIBC_2.17 pthread_timedjoin_np F GLIBC_2.17 pthread_tryjoin_np F GLIBC_2.17 sem_close F diff --git a/sysdeps/unix/sysv/linux/alpha/libc.abilist b/sysdeps/unix/sysv/linux/alpha/libc.abilist index 74998fc5b0..3ae8eb0327 100644 --- a/sysdeps/unix/sysv/linux/alpha/libc.abilist +++ b/sysdeps/unix/sysv/linux/alpha/libc.abilist @@ -921,6 +921,7 @@ GLIBC_2.0 pthread_setcanceltype F GLIBC_2.0 pthread_setschedparam F GLIBC_2.0 pthread_setspecific F GLIBC_2.0 pthread_sigmask F +GLIBC_2.0 pthread_testcancel F GLIBC_2.0 ptrace F GLIBC_2.0 putc F GLIBC_2.0 putc_unlocked F @@ -2425,6 +2426,7 @@ GLIBC_2.34 pthread_spin_init F GLIBC_2.34 pthread_spin_lock F GLIBC_2.34 pthread_spin_trylock F GLIBC_2.34 pthread_spin_unlock F +GLIBC_2.34 pthread_testcancel F GLIBC_2.34 thrd_exit F GLIBC_2.34 tss_create F GLIBC_2.34 tss_delete F diff --git a/sysdeps/unix/sysv/linux/alpha/libpthread.abilist b/sysdeps/unix/sysv/linux/alpha/libpthread.abilist index 5eae00fd6b..2633a1c816 100644 --- a/sysdeps/unix/sysv/linux/alpha/libpthread.abilist +++ b/sysdeps/unix/sysv/linux/alpha/libpthread.abilist @@ -9,7 +9,6 @@ GLIBC_2.0 pthread_cancel F GLIBC_2.0 pthread_create F GLIBC_2.0 pthread_detach F GLIBC_2.0 pthread_join F -GLIBC_2.0 pthread_testcancel F GLIBC_2.0 sem_destroy F GLIBC_2.0 sem_getvalue F GLIBC_2.0 sem_init F diff --git a/sysdeps/unix/sysv/linux/arc/libc.abilist b/sysdeps/unix/sysv/linux/arc/libc.abilist index 8ce7184069..068e992c7d 100644 --- a/sysdeps/unix/sysv/linux/arc/libc.abilist +++ b/sysdeps/unix/sysv/linux/arc/libc.abilist @@ -1473,6 +1473,7 @@ GLIBC_2.32 pthread_spin_init F GLIBC_2.32 pthread_spin_lock F GLIBC_2.32 pthread_spin_trylock F GLIBC_2.32 pthread_spin_unlock F +GLIBC_2.32 pthread_testcancel F GLIBC_2.32 pthread_yield F GLIBC_2.32 ptrace F GLIBC_2.32 ptsname F @@ -2103,6 +2104,7 @@ GLIBC_2.34 pthread_spin_init F GLIBC_2.34 pthread_spin_lock F GLIBC_2.34 pthread_spin_trylock F GLIBC_2.34 pthread_spin_unlock F +GLIBC_2.34 pthread_testcancel F GLIBC_2.34 thrd_exit F GLIBC_2.34 tss_create F GLIBC_2.34 tss_delete F diff --git a/sysdeps/unix/sysv/linux/arc/libpthread.abilist b/sysdeps/unix/sysv/linux/arc/libpthread.abilist index 8d12b93ff1..fbe2217064 100644 --- a/sysdeps/unix/sysv/linux/arc/libpthread.abilist +++ b/sysdeps/unix/sysv/linux/arc/libpthread.abilist @@ -40,7 +40,6 @@ GLIBC_2.32 pthread_setconcurrency F GLIBC_2.32 pthread_setname_np F GLIBC_2.32 pthread_setschedprio F GLIBC_2.32 pthread_sigqueue F -GLIBC_2.32 pthread_testcancel F GLIBC_2.32 pthread_timedjoin_np F GLIBC_2.32 pthread_tryjoin_np F GLIBC_2.32 sem_clockwait F diff --git a/sysdeps/unix/sysv/linux/arm/be/libc.abilist b/sysdeps/unix/sysv/linux/arm/be/libc.abilist index 3eb6816ffc..a1c40d02b7 100644 --- a/sysdeps/unix/sysv/linux/arm/be/libc.abilist +++ b/sysdeps/unix/sysv/linux/arm/be/libc.abilist @@ -251,6 +251,7 @@ GLIBC_2.34 pthread_spin_init F GLIBC_2.34 pthread_spin_lock F GLIBC_2.34 pthread_spin_trylock F GLIBC_2.34 pthread_spin_unlock F +GLIBC_2.34 pthread_testcancel F GLIBC_2.34 thrd_exit F GLIBC_2.34 tss_create F GLIBC_2.34 tss_delete F @@ -1719,6 +1720,7 @@ GLIBC_2.4 pthread_spin_init F GLIBC_2.4 pthread_spin_lock F GLIBC_2.4 pthread_spin_trylock F GLIBC_2.4 pthread_spin_unlock F +GLIBC_2.4 pthread_testcancel F GLIBC_2.4 pthread_yield F GLIBC_2.4 ptrace F GLIBC_2.4 ptsname F diff --git a/sysdeps/unix/sysv/linux/arm/be/libpthread.abilist b/sysdeps/unix/sysv/linux/arm/be/libpthread.abilist index e7907d89b8..bd82a85136 100644 --- a/sysdeps/unix/sysv/linux/arm/be/libpthread.abilist +++ b/sysdeps/unix/sysv/linux/arm/be/libpthread.abilist @@ -45,7 +45,6 @@ GLIBC_2.4 pthread_join F GLIBC_2.4 pthread_setaffinity_np F GLIBC_2.4 pthread_setconcurrency F GLIBC_2.4 pthread_setschedprio F -GLIBC_2.4 pthread_testcancel F GLIBC_2.4 pthread_timedjoin_np F GLIBC_2.4 pthread_tryjoin_np F GLIBC_2.4 sem_close F diff --git a/sysdeps/unix/sysv/linux/arm/le/libc.abilist b/sysdeps/unix/sysv/linux/arm/le/libc.abilist index bd3a7c2830..11bc55d9e7 100644 --- a/sysdeps/unix/sysv/linux/arm/le/libc.abilist +++ b/sysdeps/unix/sysv/linux/arm/le/libc.abilist @@ -248,6 +248,7 @@ GLIBC_2.34 pthread_spin_init F GLIBC_2.34 pthread_spin_lock F GLIBC_2.34 pthread_spin_trylock F GLIBC_2.34 pthread_spin_unlock F +GLIBC_2.34 pthread_testcancel F GLIBC_2.34 thrd_exit F GLIBC_2.34 tss_create F GLIBC_2.34 tss_delete F @@ -1716,6 +1717,7 @@ GLIBC_2.4 pthread_spin_init F GLIBC_2.4 pthread_spin_lock F GLIBC_2.4 pthread_spin_trylock F GLIBC_2.4 pthread_spin_unlock F +GLIBC_2.4 pthread_testcancel F GLIBC_2.4 pthread_yield F GLIBC_2.4 ptrace F GLIBC_2.4 ptsname F diff --git a/sysdeps/unix/sysv/linux/arm/le/libpthread.abilist b/sysdeps/unix/sysv/linux/arm/le/libpthread.abilist index e7907d89b8..bd82a85136 100644 --- a/sysdeps/unix/sysv/linux/arm/le/libpthread.abilist +++ b/sysdeps/unix/sysv/linux/arm/le/libpthread.abilist @@ -45,7 +45,6 @@ GLIBC_2.4 pthread_join F GLIBC_2.4 pthread_setaffinity_np F GLIBC_2.4 pthread_setconcurrency F GLIBC_2.4 pthread_setschedprio F -GLIBC_2.4 pthread_testcancel F GLIBC_2.4 pthread_timedjoin_np F GLIBC_2.4 pthread_tryjoin_np F GLIBC_2.4 sem_close F diff --git a/sysdeps/unix/sysv/linux/csky/libc.abilist b/sysdeps/unix/sysv/linux/csky/libc.abilist index 14dade3ad5..60c9fae933 100644 --- a/sysdeps/unix/sysv/linux/csky/libc.abilist +++ b/sysdeps/unix/sysv/linux/csky/libc.abilist @@ -1530,6 +1530,7 @@ GLIBC_2.29 pthread_spin_init F GLIBC_2.29 pthread_spin_lock F GLIBC_2.29 pthread_spin_trylock F GLIBC_2.29 pthread_spin_unlock F +GLIBC_2.29 pthread_testcancel F GLIBC_2.29 pthread_yield F GLIBC_2.29 ptrace F GLIBC_2.29 ptsname F @@ -2287,6 +2288,7 @@ GLIBC_2.34 pthread_spin_init F GLIBC_2.34 pthread_spin_lock F GLIBC_2.34 pthread_spin_trylock F GLIBC_2.34 pthread_spin_unlock F +GLIBC_2.34 pthread_testcancel F GLIBC_2.34 thrd_exit F GLIBC_2.34 tss_create F GLIBC_2.34 tss_delete F diff --git a/sysdeps/unix/sysv/linux/csky/libpthread.abilist b/sysdeps/unix/sysv/linux/csky/libpthread.abilist index 4030a58e1a..c1e500ab59 100644 --- a/sysdeps/unix/sysv/linux/csky/libpthread.abilist +++ b/sysdeps/unix/sysv/linux/csky/libpthread.abilist @@ -39,7 +39,6 @@ GLIBC_2.29 pthread_setconcurrency F GLIBC_2.29 pthread_setname_np F GLIBC_2.29 pthread_setschedprio F GLIBC_2.29 pthread_sigqueue F -GLIBC_2.29 pthread_testcancel F GLIBC_2.29 pthread_timedjoin_np F GLIBC_2.29 pthread_tryjoin_np F GLIBC_2.29 sem_close F diff --git a/sysdeps/unix/sysv/linux/hppa/libc.abilist b/sysdeps/unix/sysv/linux/hppa/libc.abilist index 286ac0c44d..b4081bab82 100644 --- a/sysdeps/unix/sysv/linux/hppa/libc.abilist +++ b/sysdeps/unix/sysv/linux/hppa/libc.abilist @@ -1341,6 +1341,7 @@ GLIBC_2.2 pthread_spin_init F GLIBC_2.2 pthread_spin_lock F GLIBC_2.2 pthread_spin_trylock F GLIBC_2.2 pthread_spin_unlock F +GLIBC_2.2 pthread_testcancel F GLIBC_2.2 pthread_yield F GLIBC_2.2 ptrace F GLIBC_2.2 ptsname F @@ -2238,6 +2239,7 @@ GLIBC_2.34 pthread_spin_init F GLIBC_2.34 pthread_spin_lock F GLIBC_2.34 pthread_spin_trylock F GLIBC_2.34 pthread_spin_unlock F +GLIBC_2.34 pthread_testcancel F GLIBC_2.34 thrd_exit F GLIBC_2.34 tss_create F GLIBC_2.34 tss_delete F diff --git a/sysdeps/unix/sysv/linux/hppa/libpthread.abilist b/sysdeps/unix/sysv/linux/hppa/libpthread.abilist index af0359bd14..0d4dfb6328 100644 --- a/sysdeps/unix/sysv/linux/hppa/libpthread.abilist +++ b/sysdeps/unix/sysv/linux/hppa/libpthread.abilist @@ -31,7 +31,6 @@ GLIBC_2.2 pthread_getconcurrency F GLIBC_2.2 pthread_getcpuclockid F GLIBC_2.2 pthread_join F GLIBC_2.2 pthread_setconcurrency F -GLIBC_2.2 pthread_testcancel F GLIBC_2.2 sem_close F GLIBC_2.2 sem_destroy F GLIBC_2.2 sem_getvalue F diff --git a/sysdeps/unix/sysv/linux/i386/libc.abilist b/sysdeps/unix/sysv/linux/i386/libc.abilist index e33fe31138..a482370926 100644 --- a/sysdeps/unix/sysv/linux/i386/libc.abilist +++ b/sysdeps/unix/sysv/linux/i386/libc.abilist @@ -898,6 +898,7 @@ GLIBC_2.0 pthread_setcanceltype F GLIBC_2.0 pthread_setschedparam F GLIBC_2.0 pthread_setspecific F GLIBC_2.0 pthread_sigmask F +GLIBC_2.0 pthread_testcancel F GLIBC_2.0 ptrace F GLIBC_2.0 putc F GLIBC_2.0 putc_unlocked F @@ -2415,6 +2416,7 @@ GLIBC_2.34 pthread_spin_init F GLIBC_2.34 pthread_spin_lock F GLIBC_2.34 pthread_spin_trylock F GLIBC_2.34 pthread_spin_unlock F +GLIBC_2.34 pthread_testcancel F GLIBC_2.34 thrd_exit F GLIBC_2.34 tss_create F GLIBC_2.34 tss_delete F diff --git a/sysdeps/unix/sysv/linux/i386/libpthread.abilist b/sysdeps/unix/sysv/linux/i386/libpthread.abilist index 1fdd0c7758..7b43b9309b 100644 --- a/sysdeps/unix/sysv/linux/i386/libpthread.abilist +++ b/sysdeps/unix/sysv/linux/i386/libpthread.abilist @@ -9,7 +9,6 @@ GLIBC_2.0 pthread_cancel F GLIBC_2.0 pthread_create F GLIBC_2.0 pthread_detach F GLIBC_2.0 pthread_join F -GLIBC_2.0 pthread_testcancel F GLIBC_2.0 sem_destroy F GLIBC_2.0 sem_getvalue F GLIBC_2.0 sem_init F diff --git a/sysdeps/unix/sysv/linux/ia64/libc.abilist b/sysdeps/unix/sysv/linux/ia64/libc.abilist index eedd7293e2..8e9234969d 100644 --- a/sysdeps/unix/sysv/linux/ia64/libc.abilist +++ b/sysdeps/unix/sysv/linux/ia64/libc.abilist @@ -1362,6 +1362,7 @@ GLIBC_2.2 pthread_spin_init F GLIBC_2.2 pthread_spin_lock F GLIBC_2.2 pthread_spin_trylock F GLIBC_2.2 pthread_spin_unlock F +GLIBC_2.2 pthread_testcancel F GLIBC_2.2 pthread_yield F GLIBC_2.2 ptrace F GLIBC_2.2 ptsname F @@ -2272,6 +2273,7 @@ GLIBC_2.34 pthread_spin_init F GLIBC_2.34 pthread_spin_lock F GLIBC_2.34 pthread_spin_trylock F GLIBC_2.34 pthread_spin_unlock F +GLIBC_2.34 pthread_testcancel F GLIBC_2.34 thrd_exit F GLIBC_2.34 tss_create F GLIBC_2.34 tss_delete F diff --git a/sysdeps/unix/sysv/linux/ia64/libpthread.abilist b/sysdeps/unix/sysv/linux/ia64/libpthread.abilist index c6c1f7ac7b..cef26d71d6 100644 --- a/sysdeps/unix/sysv/linux/ia64/libpthread.abilist +++ b/sysdeps/unix/sysv/linux/ia64/libpthread.abilist @@ -31,7 +31,6 @@ GLIBC_2.2 pthread_getconcurrency F GLIBC_2.2 pthread_getcpuclockid F GLIBC_2.2 pthread_join F GLIBC_2.2 pthread_setconcurrency F -GLIBC_2.2 pthread_testcancel F GLIBC_2.2 sem_close F GLIBC_2.2 sem_destroy F GLIBC_2.2 sem_getvalue F diff --git a/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist b/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist index 0cf1c052db..0ff3a75d5c 100644 --- a/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist +++ b/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist @@ -252,6 +252,7 @@ GLIBC_2.34 pthread_spin_init F GLIBC_2.34 pthread_spin_lock F GLIBC_2.34 pthread_spin_trylock F GLIBC_2.34 pthread_spin_unlock F +GLIBC_2.34 pthread_testcancel F GLIBC_2.34 thrd_exit F GLIBC_2.34 tss_create F GLIBC_2.34 tss_delete F @@ -1699,6 +1700,7 @@ GLIBC_2.4 pthread_spin_init F GLIBC_2.4 pthread_spin_lock F GLIBC_2.4 pthread_spin_trylock F GLIBC_2.4 pthread_spin_unlock F +GLIBC_2.4 pthread_testcancel F GLIBC_2.4 pthread_yield F GLIBC_2.4 ptrace F GLIBC_2.4 ptsname F diff --git a/sysdeps/unix/sysv/linux/m68k/coldfire/libpthread.abilist b/sysdeps/unix/sysv/linux/m68k/coldfire/libpthread.abilist index e7907d89b8..bd82a85136 100644 --- a/sysdeps/unix/sysv/linux/m68k/coldfire/libpthread.abilist +++ b/sysdeps/unix/sysv/linux/m68k/coldfire/libpthread.abilist @@ -45,7 +45,6 @@ GLIBC_2.4 pthread_join F GLIBC_2.4 pthread_setaffinity_np F GLIBC_2.4 pthread_setconcurrency F GLIBC_2.4 pthread_setschedprio F -GLIBC_2.4 pthread_testcancel F GLIBC_2.4 pthread_timedjoin_np F GLIBC_2.4 pthread_tryjoin_np F GLIBC_2.4 sem_close F diff --git a/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist b/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist index 9a457376e2..ab29bb553c 100644 --- a/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist +++ b/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist @@ -897,6 +897,7 @@ GLIBC_2.0 pthread_setcanceltype F GLIBC_2.0 pthread_setschedparam F GLIBC_2.0 pthread_setspecific F GLIBC_2.0 pthread_sigmask F +GLIBC_2.0 pthread_testcancel F GLIBC_2.0 ptrace F GLIBC_2.0 putc F GLIBC_2.0 putc_unlocked F @@ -2358,6 +2359,7 @@ GLIBC_2.34 pthread_spin_init F GLIBC_2.34 pthread_spin_lock F GLIBC_2.34 pthread_spin_trylock F GLIBC_2.34 pthread_spin_unlock F +GLIBC_2.34 pthread_testcancel F GLIBC_2.34 thrd_exit F GLIBC_2.34 tss_create F GLIBC_2.34 tss_delete F diff --git a/sysdeps/unix/sysv/linux/m68k/m680x0/libpthread.abilist b/sysdeps/unix/sysv/linux/m68k/m680x0/libpthread.abilist index 1fdd0c7758..7b43b9309b 100644 --- a/sysdeps/unix/sysv/linux/m68k/m680x0/libpthread.abilist +++ b/sysdeps/unix/sysv/linux/m68k/m680x0/libpthread.abilist @@ -9,7 +9,6 @@ GLIBC_2.0 pthread_cancel F GLIBC_2.0 pthread_create F GLIBC_2.0 pthread_detach F GLIBC_2.0 pthread_join F -GLIBC_2.0 pthread_testcancel F GLIBC_2.0 sem_destroy F GLIBC_2.0 sem_getvalue F GLIBC_2.0 sem_init F diff --git a/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist b/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist index 540e503a0b..baa46ca8c2 100644 --- a/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist +++ b/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist @@ -1532,6 +1532,7 @@ GLIBC_2.18 pthread_spin_init F GLIBC_2.18 pthread_spin_lock F GLIBC_2.18 pthread_spin_trylock F GLIBC_2.18 pthread_spin_unlock F +GLIBC_2.18 pthread_testcancel F GLIBC_2.18 pthread_yield F GLIBC_2.18 ptrace F GLIBC_2.18 ptsname F @@ -2338,6 +2339,7 @@ GLIBC_2.34 pthread_spin_init F GLIBC_2.34 pthread_spin_lock F GLIBC_2.34 pthread_spin_trylock F GLIBC_2.34 pthread_spin_unlock F +GLIBC_2.34 pthread_testcancel F GLIBC_2.34 thrd_exit F GLIBC_2.34 tss_create F GLIBC_2.34 tss_delete F diff --git a/sysdeps/unix/sysv/linux/microblaze/be/libpthread.abilist b/sysdeps/unix/sysv/linux/microblaze/be/libpthread.abilist index 785630fec3..6bfa410c44 100644 --- a/sysdeps/unix/sysv/linux/microblaze/be/libpthread.abilist +++ b/sysdeps/unix/sysv/linux/microblaze/be/libpthread.abilist @@ -39,7 +39,6 @@ GLIBC_2.18 pthread_setconcurrency F GLIBC_2.18 pthread_setname_np F GLIBC_2.18 pthread_setschedprio F GLIBC_2.18 pthread_sigqueue F -GLIBC_2.18 pthread_testcancel F GLIBC_2.18 pthread_timedjoin_np F GLIBC_2.18 pthread_tryjoin_np F GLIBC_2.18 sem_close F diff --git a/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist b/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist index f630215296..b5640c3a40 100644 --- a/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist +++ b/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist @@ -1532,6 +1532,7 @@ GLIBC_2.18 pthread_spin_init F GLIBC_2.18 pthread_spin_lock F GLIBC_2.18 pthread_spin_trylock F GLIBC_2.18 pthread_spin_unlock F +GLIBC_2.18 pthread_testcancel F GLIBC_2.18 pthread_yield F GLIBC_2.18 ptrace F GLIBC_2.18 ptsname F @@ -2335,6 +2336,7 @@ GLIBC_2.34 pthread_spin_init F GLIBC_2.34 pthread_spin_lock F GLIBC_2.34 pthread_spin_trylock F GLIBC_2.34 pthread_spin_unlock F +GLIBC_2.34 pthread_testcancel F GLIBC_2.34 thrd_exit F GLIBC_2.34 tss_create F GLIBC_2.34 tss_delete F diff --git a/sysdeps/unix/sysv/linux/microblaze/le/libpthread.abilist b/sysdeps/unix/sysv/linux/microblaze/le/libpthread.abilist index 785630fec3..6bfa410c44 100644 --- a/sysdeps/unix/sysv/linux/microblaze/le/libpthread.abilist +++ b/sysdeps/unix/sysv/linux/microblaze/le/libpthread.abilist @@ -39,7 +39,6 @@ GLIBC_2.18 pthread_setconcurrency F GLIBC_2.18 pthread_setname_np F GLIBC_2.18 pthread_setschedprio F GLIBC_2.18 pthread_sigqueue F -GLIBC_2.18 pthread_testcancel F GLIBC_2.18 pthread_timedjoin_np F GLIBC_2.18 pthread_tryjoin_np F GLIBC_2.18 sem_close F diff --git a/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist b/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist index f4f2d706c0..f5193f5a30 100644 --- a/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist +++ b/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist @@ -894,6 +894,7 @@ GLIBC_2.0 pthread_setcanceltype F GLIBC_2.0 pthread_setschedparam F GLIBC_2.0 pthread_setspecific F GLIBC_2.0 pthread_sigmask F +GLIBC_2.0 pthread_testcancel F GLIBC_2.0 ptrace F GLIBC_2.0 putc F GLIBC_2.0 putc_unlocked F @@ -2321,6 +2322,7 @@ GLIBC_2.34 pthread_spin_init F GLIBC_2.34 pthread_spin_lock F GLIBC_2.34 pthread_spin_trylock F GLIBC_2.34 pthread_spin_unlock F +GLIBC_2.34 pthread_testcancel F GLIBC_2.34 thrd_exit F GLIBC_2.34 tss_create F GLIBC_2.34 tss_delete F diff --git a/sysdeps/unix/sysv/linux/mips/mips32/libpthread.abilist b/sysdeps/unix/sysv/linux/mips/mips32/libpthread.abilist index 8df7179bd2..83434ae1b6 100644 --- a/sysdeps/unix/sysv/linux/mips/mips32/libpthread.abilist +++ b/sysdeps/unix/sysv/linux/mips/mips32/libpthread.abilist @@ -9,7 +9,6 @@ GLIBC_2.0 pthread_cancel F GLIBC_2.0 pthread_create F GLIBC_2.0 pthread_detach F GLIBC_2.0 pthread_join F -GLIBC_2.0 pthread_testcancel F GLIBC_2.0 sem_destroy F GLIBC_2.0 sem_getvalue F GLIBC_2.0 sem_init F diff --git a/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist b/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist index ee5b775cd0..a6c6ae308a 100644 --- a/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist +++ b/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist @@ -894,6 +894,7 @@ GLIBC_2.0 pthread_setcanceltype F GLIBC_2.0 pthread_setschedparam F GLIBC_2.0 pthread_setspecific F GLIBC_2.0 pthread_sigmask F +GLIBC_2.0 pthread_testcancel F GLIBC_2.0 ptrace F GLIBC_2.0 putc F GLIBC_2.0 putc_unlocked F @@ -2319,6 +2320,7 @@ GLIBC_2.34 pthread_spin_init F GLIBC_2.34 pthread_spin_lock F GLIBC_2.34 pthread_spin_trylock F GLIBC_2.34 pthread_spin_unlock F +GLIBC_2.34 pthread_testcancel F GLIBC_2.34 thrd_exit F GLIBC_2.34 tss_create F GLIBC_2.34 tss_delete F diff --git a/sysdeps/unix/sysv/linux/mips/mips64/libpthread.abilist b/sysdeps/unix/sysv/linux/mips/mips64/libpthread.abilist index 8df7179bd2..83434ae1b6 100644 --- a/sysdeps/unix/sysv/linux/mips/mips64/libpthread.abilist +++ b/sysdeps/unix/sysv/linux/mips/mips64/libpthread.abilist @@ -9,7 +9,6 @@ GLIBC_2.0 pthread_cancel F GLIBC_2.0 pthread_create F GLIBC_2.0 pthread_detach F GLIBC_2.0 pthread_join F -GLIBC_2.0 pthread_testcancel F GLIBC_2.0 sem_destroy F GLIBC_2.0 sem_getvalue F GLIBC_2.0 sem_init F diff --git a/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist b/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist index 6d9798fb9a..cd24ac6fde 100644 --- a/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist +++ b/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist @@ -894,6 +894,7 @@ GLIBC_2.0 pthread_setcanceltype F GLIBC_2.0 pthread_setschedparam F GLIBC_2.0 pthread_setspecific F GLIBC_2.0 pthread_sigmask F +GLIBC_2.0 pthread_testcancel F GLIBC_2.0 ptrace F GLIBC_2.0 putc F GLIBC_2.0 putc_unlocked F @@ -2327,6 +2328,7 @@ GLIBC_2.34 pthread_spin_init F GLIBC_2.34 pthread_spin_lock F GLIBC_2.34 pthread_spin_trylock F GLIBC_2.34 pthread_spin_unlock F +GLIBC_2.34 pthread_testcancel F GLIBC_2.34 thrd_exit F GLIBC_2.34 tss_create F GLIBC_2.34 tss_delete F diff --git a/sysdeps/unix/sysv/linux/mips/mips64/n64/libc.abilist b/sysdeps/unix/sysv/linux/mips/mips64/n64/libc.abilist index e6d6053906..9a71aa83dd 100644 --- a/sysdeps/unix/sysv/linux/mips/mips64/n64/libc.abilist +++ b/sysdeps/unix/sysv/linux/mips/mips64/n64/libc.abilist @@ -892,6 +892,7 @@ GLIBC_2.0 pthread_setcanceltype F GLIBC_2.0 pthread_setschedparam F GLIBC_2.0 pthread_setspecific F GLIBC_2.0 pthread_sigmask F +GLIBC_2.0 pthread_testcancel F GLIBC_2.0 ptrace F GLIBC_2.0 putc F GLIBC_2.0 putc_unlocked F @@ -2321,6 +2322,7 @@ GLIBC_2.34 pthread_spin_init F GLIBC_2.34 pthread_spin_lock F GLIBC_2.34 pthread_spin_trylock F GLIBC_2.34 pthread_spin_unlock F +GLIBC_2.34 pthread_testcancel F GLIBC_2.34 thrd_exit F GLIBC_2.34 tss_create F GLIBC_2.34 tss_delete F diff --git a/sysdeps/unix/sysv/linux/nios2/libc.abilist b/sysdeps/unix/sysv/linux/nios2/libc.abilist index 743d981081..c0225a9559 100644 --- a/sysdeps/unix/sysv/linux/nios2/libc.abilist +++ b/sysdeps/unix/sysv/linux/nios2/libc.abilist @@ -1575,6 +1575,7 @@ GLIBC_2.21 pthread_spin_init F GLIBC_2.21 pthread_spin_lock F GLIBC_2.21 pthread_spin_trylock F GLIBC_2.21 pthread_spin_unlock F +GLIBC_2.21 pthread_testcancel F GLIBC_2.21 pthread_yield F GLIBC_2.21 ptrace F GLIBC_2.21 ptsname F @@ -2377,6 +2378,7 @@ GLIBC_2.34 pthread_spin_init F GLIBC_2.34 pthread_spin_lock F GLIBC_2.34 pthread_spin_trylock F GLIBC_2.34 pthread_spin_unlock F +GLIBC_2.34 pthread_testcancel F GLIBC_2.34 thrd_exit F GLIBC_2.34 tss_create F GLIBC_2.34 tss_delete F diff --git a/sysdeps/unix/sysv/linux/nios2/libpthread.abilist b/sysdeps/unix/sysv/linux/nios2/libpthread.abilist index fb9c53ec2b..197827a386 100644 --- a/sysdeps/unix/sysv/linux/nios2/libpthread.abilist +++ b/sysdeps/unix/sysv/linux/nios2/libpthread.abilist @@ -39,7 +39,6 @@ GLIBC_2.21 pthread_setconcurrency F GLIBC_2.21 pthread_setname_np F GLIBC_2.21 pthread_setschedprio F GLIBC_2.21 pthread_sigqueue F -GLIBC_2.21 pthread_testcancel F GLIBC_2.21 pthread_timedjoin_np F GLIBC_2.21 pthread_tryjoin_np F GLIBC_2.21 sem_close F diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist index e173d5a95c..c3e72afb9e 100644 --- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist +++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist @@ -905,6 +905,7 @@ GLIBC_2.0 pthread_setcanceltype F GLIBC_2.0 pthread_setschedparam F GLIBC_2.0 pthread_setspecific F GLIBC_2.0 pthread_sigmask F +GLIBC_2.0 pthread_testcancel F GLIBC_2.0 ptrace F GLIBC_2.0 putc F GLIBC_2.0 putc_unlocked F @@ -2385,6 +2386,7 @@ GLIBC_2.34 pthread_spin_init F GLIBC_2.34 pthread_spin_lock F GLIBC_2.34 pthread_spin_trylock F GLIBC_2.34 pthread_spin_unlock F +GLIBC_2.34 pthread_testcancel F GLIBC_2.34 thrd_exit F GLIBC_2.34 tss_create F GLIBC_2.34 tss_delete F diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/libpthread.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc32/libpthread.abilist index c761c15e3a..79bc809cfa 100644 --- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/libpthread.abilist +++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/libpthread.abilist @@ -9,7 +9,6 @@ GLIBC_2.0 pthread_cancel F GLIBC_2.0 pthread_create F GLIBC_2.0 pthread_detach F GLIBC_2.0 pthread_join F -GLIBC_2.0 pthread_testcancel F GLIBC_2.0 sem_destroy F GLIBC_2.0 sem_getvalue F GLIBC_2.0 sem_init F diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist index b5e32bef98..b49aacf9a0 100644 --- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist +++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist @@ -905,6 +905,7 @@ GLIBC_2.0 pthread_setcanceltype F GLIBC_2.0 pthread_setschedparam F GLIBC_2.0 pthread_setspecific F GLIBC_2.0 pthread_sigmask F +GLIBC_2.0 pthread_testcancel F GLIBC_2.0 ptrace F GLIBC_2.0 putc F GLIBC_2.0 putc_unlocked F @@ -2418,6 +2419,7 @@ GLIBC_2.34 pthread_spin_init F GLIBC_2.34 pthread_spin_lock F GLIBC_2.34 pthread_spin_trylock F GLIBC_2.34 pthread_spin_unlock F +GLIBC_2.34 pthread_testcancel F GLIBC_2.34 thrd_exit F GLIBC_2.34 tss_create F GLIBC_2.34 tss_delete F diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libc.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libc.abilist index 20168d3df3..57029e940a 100644 --- a/sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libc.abilist +++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libc.abilist @@ -1465,6 +1465,7 @@ GLIBC_2.3 pthread_spin_init F GLIBC_2.3 pthread_spin_lock F GLIBC_2.3 pthread_spin_trylock F GLIBC_2.3 pthread_spin_unlock F +GLIBC_2.3 pthread_testcancel F GLIBC_2.3 pthread_yield F GLIBC_2.3 ptrace F GLIBC_2.3 ptsname F @@ -2239,6 +2240,7 @@ GLIBC_2.34 pthread_spin_init F GLIBC_2.34 pthread_spin_lock F GLIBC_2.34 pthread_spin_trylock F GLIBC_2.34 pthread_spin_unlock F +GLIBC_2.34 pthread_testcancel F GLIBC_2.34 thrd_exit F GLIBC_2.34 tss_create F GLIBC_2.34 tss_delete F diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libpthread.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libpthread.abilist index 037f0f2839..0c5ee381d2 100644 --- a/sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libpthread.abilist +++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libpthread.abilist @@ -34,7 +34,6 @@ GLIBC_2.3 pthread_getconcurrency F GLIBC_2.3 pthread_getcpuclockid F GLIBC_2.3 pthread_join F GLIBC_2.3 pthread_setconcurrency F -GLIBC_2.3 pthread_testcancel F GLIBC_2.3 sem_close F GLIBC_2.3 sem_destroy F GLIBC_2.3 sem_getvalue F diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libc.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libc.abilist index 5f94b1ce64..65fcc483a6 100644 --- a/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libc.abilist +++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libc.abilist @@ -1618,6 +1618,7 @@ GLIBC_2.17 pthread_spin_init F GLIBC_2.17 pthread_spin_lock F GLIBC_2.17 pthread_spin_trylock F GLIBC_2.17 pthread_spin_unlock F +GLIBC_2.17 pthread_testcancel F GLIBC_2.17 pthread_yield F GLIBC_2.17 ptrace F GLIBC_2.17 ptsname F @@ -2540,6 +2541,7 @@ GLIBC_2.34 pthread_spin_init F GLIBC_2.34 pthread_spin_lock F GLIBC_2.34 pthread_spin_trylock F GLIBC_2.34 pthread_spin_unlock F +GLIBC_2.34 pthread_testcancel F GLIBC_2.34 thrd_exit F GLIBC_2.34 tss_create F GLIBC_2.34 tss_delete F diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libpthread.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libpthread.abilist index c1f11e12df..839f2ff64a 100644 --- a/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libpthread.abilist +++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libpthread.abilist @@ -37,7 +37,6 @@ GLIBC_2.17 pthread_setconcurrency F GLIBC_2.17 pthread_setname_np F GLIBC_2.17 pthread_setschedprio F GLIBC_2.17 pthread_sigqueue F -GLIBC_2.17 pthread_testcancel F GLIBC_2.17 pthread_timedjoin_np F GLIBC_2.17 pthread_tryjoin_np F GLIBC_2.17 sem_close F diff --git a/sysdeps/unix/sysv/linux/riscv/rv32/libc.abilist b/sysdeps/unix/sysv/linux/riscv/rv32/libc.abilist index 3fe5e16e5d..faddb79441 100644 --- a/sysdeps/unix/sysv/linux/riscv/rv32/libc.abilist +++ b/sysdeps/unix/sysv/linux/riscv/rv32/libc.abilist @@ -1475,6 +1475,7 @@ GLIBC_2.33 pthread_spin_init F GLIBC_2.33 pthread_spin_lock F GLIBC_2.33 pthread_spin_trylock F GLIBC_2.33 pthread_spin_unlock F +GLIBC_2.33 pthread_testcancel F GLIBC_2.33 pthread_yield F GLIBC_2.33 ptrace F GLIBC_2.33 ptsname F @@ -2105,6 +2106,7 @@ GLIBC_2.34 pthread_spin_init F GLIBC_2.34 pthread_spin_lock F GLIBC_2.34 pthread_spin_trylock F GLIBC_2.34 pthread_spin_unlock F +GLIBC_2.34 pthread_testcancel F GLIBC_2.34 thrd_exit F GLIBC_2.34 tss_create F GLIBC_2.34 tss_delete F diff --git a/sysdeps/unix/sysv/linux/riscv/rv32/libpthread.abilist b/sysdeps/unix/sysv/linux/riscv/rv32/libpthread.abilist index b06dfc1038..94fcac028c 100644 --- a/sysdeps/unix/sysv/linux/riscv/rv32/libpthread.abilist +++ b/sysdeps/unix/sysv/linux/riscv/rv32/libpthread.abilist @@ -40,7 +40,6 @@ GLIBC_2.33 pthread_setconcurrency F GLIBC_2.33 pthread_setname_np F GLIBC_2.33 pthread_setschedprio F GLIBC_2.33 pthread_sigqueue F -GLIBC_2.33 pthread_testcancel F GLIBC_2.33 pthread_timedjoin_np F GLIBC_2.33 pthread_tryjoin_np F GLIBC_2.33 sem_clockwait F diff --git a/sysdeps/unix/sysv/linux/riscv/rv64/libc.abilist b/sysdeps/unix/sysv/linux/riscv/rv64/libc.abilist index f9beb99367..0a3a366b43 100644 --- a/sysdeps/unix/sysv/linux/riscv/rv64/libc.abilist +++ b/sysdeps/unix/sysv/linux/riscv/rv64/libc.abilist @@ -1520,6 +1520,7 @@ GLIBC_2.27 pthread_spin_init F GLIBC_2.27 pthread_spin_lock F GLIBC_2.27 pthread_spin_trylock F GLIBC_2.27 pthread_spin_unlock F +GLIBC_2.27 pthread_testcancel F GLIBC_2.27 pthread_yield F GLIBC_2.27 ptrace F GLIBC_2.27 ptsname F @@ -2305,6 +2306,7 @@ GLIBC_2.34 pthread_spin_init F GLIBC_2.34 pthread_spin_lock F GLIBC_2.34 pthread_spin_trylock F GLIBC_2.34 pthread_spin_unlock F +GLIBC_2.34 pthread_testcancel F GLIBC_2.34 thrd_exit F GLIBC_2.34 tss_create F GLIBC_2.34 tss_delete F diff --git a/sysdeps/unix/sysv/linux/riscv/rv64/libpthread.abilist b/sysdeps/unix/sysv/linux/riscv/rv64/libpthread.abilist index 5a7d9561fd..fdab0f5ab4 100644 --- a/sysdeps/unix/sysv/linux/riscv/rv64/libpthread.abilist +++ b/sysdeps/unix/sysv/linux/riscv/rv64/libpthread.abilist @@ -39,7 +39,6 @@ GLIBC_2.27 pthread_setconcurrency F GLIBC_2.27 pthread_setname_np F GLIBC_2.27 pthread_setschedprio F GLIBC_2.27 pthread_sigqueue F -GLIBC_2.27 pthread_testcancel F GLIBC_2.27 pthread_timedjoin_np F GLIBC_2.27 pthread_tryjoin_np F GLIBC_2.27 sem_close F diff --git a/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist b/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist index bfa492a8c7..1a6f72ff1d 100644 --- a/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist +++ b/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist @@ -896,6 +896,7 @@ GLIBC_2.0 pthread_setcanceltype F GLIBC_2.0 pthread_setschedparam F GLIBC_2.0 pthread_setspecific F GLIBC_2.0 pthread_sigmask F +GLIBC_2.0 pthread_testcancel F GLIBC_2.0 ptrace F GLIBC_2.0 putc F GLIBC_2.0 putc_unlocked F @@ -2383,6 +2384,7 @@ GLIBC_2.34 pthread_spin_init F GLIBC_2.34 pthread_spin_lock F GLIBC_2.34 pthread_spin_trylock F GLIBC_2.34 pthread_spin_unlock F +GLIBC_2.34 pthread_testcancel F GLIBC_2.34 thrd_exit F GLIBC_2.34 tss_create F GLIBC_2.34 tss_delete F diff --git a/sysdeps/unix/sysv/linux/s390/s390-32/libpthread.abilist b/sysdeps/unix/sysv/linux/s390/s390-32/libpthread.abilist index ddcff610d2..911048092d 100644 --- a/sysdeps/unix/sysv/linux/s390/s390-32/libpthread.abilist +++ b/sysdeps/unix/sysv/linux/s390/s390-32/libpthread.abilist @@ -9,7 +9,6 @@ GLIBC_2.0 pthread_cancel F GLIBC_2.0 pthread_create F GLIBC_2.0 pthread_detach F GLIBC_2.0 pthread_join F -GLIBC_2.0 pthread_testcancel F GLIBC_2.0 sem_destroy F GLIBC_2.0 sem_getvalue F GLIBC_2.0 sem_init F diff --git a/sysdeps/unix/sysv/linux/s390/s390-64/libc.abilist b/sysdeps/unix/sysv/linux/s390/s390-64/libc.abilist index 27e9b47768..f21fde6bca 100644 --- a/sysdeps/unix/sysv/linux/s390/s390-64/libc.abilist +++ b/sysdeps/unix/sysv/linux/s390/s390-64/libc.abilist @@ -1359,6 +1359,7 @@ GLIBC_2.2 pthread_spin_init F GLIBC_2.2 pthread_spin_lock F GLIBC_2.2 pthread_spin_trylock F GLIBC_2.2 pthread_spin_unlock F +GLIBC_2.2 pthread_testcancel F GLIBC_2.2 pthread_yield F GLIBC_2.2 ptrace F GLIBC_2.2 ptsname F @@ -2276,6 +2277,7 @@ GLIBC_2.34 pthread_spin_init F GLIBC_2.34 pthread_spin_lock F GLIBC_2.34 pthread_spin_trylock F GLIBC_2.34 pthread_spin_unlock F +GLIBC_2.34 pthread_testcancel F GLIBC_2.34 thrd_exit F GLIBC_2.34 tss_create F GLIBC_2.34 tss_delete F diff --git a/sysdeps/unix/sysv/linux/s390/s390-64/libpthread.abilist b/sysdeps/unix/sysv/linux/s390/s390-64/libpthread.abilist index ffe9d5fed1..c5c78cb049 100644 --- a/sysdeps/unix/sysv/linux/s390/s390-64/libpthread.abilist +++ b/sysdeps/unix/sysv/linux/s390/s390-64/libpthread.abilist @@ -32,7 +32,6 @@ GLIBC_2.2 pthread_getconcurrency F GLIBC_2.2 pthread_getcpuclockid F GLIBC_2.2 pthread_join F GLIBC_2.2 pthread_setconcurrency F -GLIBC_2.2 pthread_testcancel F GLIBC_2.2 sem_close F GLIBC_2.2 sem_destroy F GLIBC_2.2 sem_getvalue F diff --git a/sysdeps/unix/sysv/linux/sh/be/libc.abilist b/sysdeps/unix/sysv/linux/sh/be/libc.abilist index b5cd5109ad..15ee14939e 100644 --- a/sysdeps/unix/sysv/linux/sh/be/libc.abilist +++ b/sysdeps/unix/sysv/linux/sh/be/libc.abilist @@ -1345,6 +1345,7 @@ GLIBC_2.2 pthread_spin_init F GLIBC_2.2 pthread_spin_lock F GLIBC_2.2 pthread_spin_trylock F GLIBC_2.2 pthread_spin_unlock F +GLIBC_2.2 pthread_testcancel F GLIBC_2.2 pthread_yield F GLIBC_2.2 ptrace F GLIBC_2.2 ptsname F @@ -2245,6 +2246,7 @@ GLIBC_2.34 pthread_spin_init F GLIBC_2.34 pthread_spin_lock F GLIBC_2.34 pthread_spin_trylock F GLIBC_2.34 pthread_spin_unlock F +GLIBC_2.34 pthread_testcancel F GLIBC_2.34 thrd_exit F GLIBC_2.34 tss_create F GLIBC_2.34 tss_delete F diff --git a/sysdeps/unix/sysv/linux/sh/be/libpthread.abilist b/sysdeps/unix/sysv/linux/sh/be/libpthread.abilist index af0359bd14..0d4dfb6328 100644 --- a/sysdeps/unix/sysv/linux/sh/be/libpthread.abilist +++ b/sysdeps/unix/sysv/linux/sh/be/libpthread.abilist @@ -31,7 +31,6 @@ GLIBC_2.2 pthread_getconcurrency F GLIBC_2.2 pthread_getcpuclockid F GLIBC_2.2 pthread_join F GLIBC_2.2 pthread_setconcurrency F -GLIBC_2.2 pthread_testcancel F GLIBC_2.2 sem_close F GLIBC_2.2 sem_destroy F GLIBC_2.2 sem_getvalue F diff --git a/sysdeps/unix/sysv/linux/sh/le/libc.abilist b/sysdeps/unix/sysv/linux/sh/le/libc.abilist index 1b20c9fcb1..533822d194 100644 --- a/sysdeps/unix/sysv/linux/sh/le/libc.abilist +++ b/sysdeps/unix/sysv/linux/sh/le/libc.abilist @@ -1345,6 +1345,7 @@ GLIBC_2.2 pthread_spin_init F GLIBC_2.2 pthread_spin_lock F GLIBC_2.2 pthread_spin_trylock F GLIBC_2.2 pthread_spin_unlock F +GLIBC_2.2 pthread_testcancel F GLIBC_2.2 pthread_yield F GLIBC_2.2 ptrace F GLIBC_2.2 ptsname F @@ -2242,6 +2243,7 @@ GLIBC_2.34 pthread_spin_init F GLIBC_2.34 pthread_spin_lock F GLIBC_2.34 pthread_spin_trylock F GLIBC_2.34 pthread_spin_unlock F +GLIBC_2.34 pthread_testcancel F GLIBC_2.34 thrd_exit F GLIBC_2.34 tss_create F GLIBC_2.34 tss_delete F diff --git a/sysdeps/unix/sysv/linux/sh/le/libpthread.abilist b/sysdeps/unix/sysv/linux/sh/le/libpthread.abilist index af0359bd14..0d4dfb6328 100644 --- a/sysdeps/unix/sysv/linux/sh/le/libpthread.abilist +++ b/sysdeps/unix/sysv/linux/sh/le/libpthread.abilist @@ -31,7 +31,6 @@ GLIBC_2.2 pthread_getconcurrency F GLIBC_2.2 pthread_getcpuclockid F GLIBC_2.2 pthread_join F GLIBC_2.2 pthread_setconcurrency F -GLIBC_2.2 pthread_testcancel F GLIBC_2.2 sem_close F GLIBC_2.2 sem_destroy F GLIBC_2.2 sem_getvalue F diff --git a/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist b/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist index c99298c588..0116558e17 100644 --- a/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist +++ b/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist @@ -899,6 +899,7 @@ GLIBC_2.0 pthread_setcanceltype F GLIBC_2.0 pthread_setschedparam F GLIBC_2.0 pthread_setspecific F GLIBC_2.0 pthread_sigmask F +GLIBC_2.0 pthread_testcancel F GLIBC_2.0 ptrace F GLIBC_2.0 putc F GLIBC_2.0 putc_unlocked F @@ -2374,6 +2375,7 @@ GLIBC_2.34 pthread_spin_init F GLIBC_2.34 pthread_spin_lock F GLIBC_2.34 pthread_spin_trylock F GLIBC_2.34 pthread_spin_unlock F +GLIBC_2.34 pthread_testcancel F GLIBC_2.34 thrd_exit F GLIBC_2.34 tss_create F GLIBC_2.34 tss_delete F diff --git a/sysdeps/unix/sysv/linux/sparc/sparc32/libpthread.abilist b/sysdeps/unix/sysv/linux/sparc/sparc32/libpthread.abilist index 5eae00fd6b..2633a1c816 100644 --- a/sysdeps/unix/sysv/linux/sparc/sparc32/libpthread.abilist +++ b/sysdeps/unix/sysv/linux/sparc/sparc32/libpthread.abilist @@ -9,7 +9,6 @@ GLIBC_2.0 pthread_cancel F GLIBC_2.0 pthread_create F GLIBC_2.0 pthread_detach F GLIBC_2.0 pthread_join F -GLIBC_2.0 pthread_testcancel F GLIBC_2.0 sem_destroy F GLIBC_2.0 sem_getvalue F GLIBC_2.0 sem_init F diff --git a/sysdeps/unix/sysv/linux/sparc/sparc64/libc.abilist b/sysdeps/unix/sysv/linux/sparc/sparc64/libc.abilist index 19c6041c49..5bf6712979 100644 --- a/sysdeps/unix/sysv/linux/sparc/sparc64/libc.abilist +++ b/sysdeps/unix/sysv/linux/sparc/sparc64/libc.abilist @@ -1388,6 +1388,7 @@ GLIBC_2.2 pthread_spin_init F GLIBC_2.2 pthread_spin_lock F GLIBC_2.2 pthread_spin_trylock F GLIBC_2.2 pthread_spin_unlock F +GLIBC_2.2 pthread_testcancel F GLIBC_2.2 pthread_yield F GLIBC_2.2 ptrace F GLIBC_2.2 ptsname F @@ -2293,6 +2294,7 @@ GLIBC_2.34 pthread_spin_init F GLIBC_2.34 pthread_spin_lock F GLIBC_2.34 pthread_spin_trylock F GLIBC_2.34 pthread_spin_unlock F +GLIBC_2.34 pthread_testcancel F GLIBC_2.34 thrd_exit F GLIBC_2.34 tss_create F GLIBC_2.34 tss_delete F diff --git a/sysdeps/unix/sysv/linux/sparc/sparc64/libpthread.abilist b/sysdeps/unix/sysv/linux/sparc/sparc64/libpthread.abilist index c6c1f7ac7b..cef26d71d6 100644 --- a/sysdeps/unix/sysv/linux/sparc/sparc64/libpthread.abilist +++ b/sysdeps/unix/sysv/linux/sparc/sparc64/libpthread.abilist @@ -31,7 +31,6 @@ GLIBC_2.2 pthread_getconcurrency F GLIBC_2.2 pthread_getcpuclockid F GLIBC_2.2 pthread_join F GLIBC_2.2 pthread_setconcurrency F -GLIBC_2.2 pthread_testcancel F GLIBC_2.2 sem_close F GLIBC_2.2 sem_destroy F GLIBC_2.2 sem_getvalue F diff --git a/sysdeps/unix/sysv/linux/x86_64/64/libc.abilist b/sysdeps/unix/sysv/linux/x86_64/64/libc.abilist index 9c5096c1d9..bceb606756 100644 --- a/sysdeps/unix/sysv/linux/x86_64/64/libc.abilist +++ b/sysdeps/unix/sysv/linux/x86_64/64/libc.abilist @@ -1356,6 +1356,7 @@ GLIBC_2.2.5 pthread_spin_init F GLIBC_2.2.5 pthread_spin_lock F GLIBC_2.2.5 pthread_spin_trylock F GLIBC_2.2.5 pthread_spin_unlock F +GLIBC_2.2.5 pthread_testcancel F GLIBC_2.2.5 pthread_yield F GLIBC_2.2.5 ptrace F GLIBC_2.2.5 ptsname F @@ -2254,6 +2255,7 @@ GLIBC_2.34 pthread_spin_init F GLIBC_2.34 pthread_spin_lock F GLIBC_2.34 pthread_spin_trylock F GLIBC_2.34 pthread_spin_unlock F +GLIBC_2.34 pthread_testcancel F GLIBC_2.34 thrd_exit F GLIBC_2.34 tss_create F GLIBC_2.34 tss_delete F diff --git a/sysdeps/unix/sysv/linux/x86_64/64/libpthread.abilist b/sysdeps/unix/sysv/linux/x86_64/64/libpthread.abilist index 540c8760ed..000cf018c7 100644 --- a/sysdeps/unix/sysv/linux/x86_64/64/libpthread.abilist +++ b/sysdeps/unix/sysv/linux/x86_64/64/libpthread.abilist @@ -31,7 +31,6 @@ GLIBC_2.2.5 pthread_getconcurrency F GLIBC_2.2.5 pthread_getcpuclockid F GLIBC_2.2.5 pthread_join F GLIBC_2.2.5 pthread_setconcurrency F -GLIBC_2.2.5 pthread_testcancel F GLIBC_2.2.5 sem_close F GLIBC_2.2.5 sem_destroy F GLIBC_2.2.5 sem_getvalue F diff --git a/sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist b/sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist index 15bec846ec..ae2a8e54c7 100644 --- a/sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist +++ b/sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist @@ -1537,6 +1537,7 @@ GLIBC_2.16 pthread_spin_init F GLIBC_2.16 pthread_spin_lock F GLIBC_2.16 pthread_spin_trylock F GLIBC_2.16 pthread_spin_unlock F +GLIBC_2.16 pthread_testcancel F GLIBC_2.16 pthread_yield F GLIBC_2.16 ptrace F GLIBC_2.16 ptsname F @@ -2359,6 +2360,7 @@ GLIBC_2.34 pthread_spin_init F GLIBC_2.34 pthread_spin_lock F GLIBC_2.34 pthread_spin_trylock F GLIBC_2.34 pthread_spin_unlock F +GLIBC_2.34 pthread_testcancel F GLIBC_2.34 thrd_exit F GLIBC_2.34 tss_create F GLIBC_2.34 tss_delete F diff --git a/sysdeps/unix/sysv/linux/x86_64/x32/libpthread.abilist b/sysdeps/unix/sysv/linux/x86_64/x32/libpthread.abilist index 01f6915331..068065e40c 100644 --- a/sysdeps/unix/sysv/linux/x86_64/x32/libpthread.abilist +++ b/sysdeps/unix/sysv/linux/x86_64/x32/libpthread.abilist @@ -37,7 +37,6 @@ GLIBC_2.16 pthread_setconcurrency F GLIBC_2.16 pthread_setname_np F GLIBC_2.16 pthread_setschedprio F GLIBC_2.16 pthread_sigqueue F -GLIBC_2.16 pthread_testcancel F GLIBC_2.16 pthread_timedjoin_np F GLIBC_2.16 pthread_tryjoin_np F GLIBC_2.16 sem_close F From patchwork Mon May 3 21:00:03 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adhemerval Zanella X-Patchwork-Id: 43239 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 8A2D1395742E; Mon, 3 May 2021 21:00:18 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 8A2D1395742E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1620075618; bh=gBJp2fdvTbw+QwStCVivUImNP5wBw5xFMUPTD5ObOdc=; h=To:Subject:Date:In-Reply-To:References:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=okk3Qp11qjFH4+IALeQahhq7b9BYfdCL0KEIbnmdJGm60r/hNdDlDPAMSncPEBgvl 6TEMSOxU1ifMtan3JNWwZ9z4Po6/R7NIpOakTFuNW17T8myXGnUQgNhdD5+JypRyo6 NSICTK0azud5J/R15f9+Yem0I10VwT62EecqEFKQ= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-qk1-x729.google.com (mail-qk1-x729.google.com [IPv6:2607:f8b0:4864:20::729]) by sourceware.org (Postfix) with ESMTPS id 618D139551D7 for ; Mon, 3 May 2021 21:00:15 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 618D139551D7 Received: by mail-qk1-x729.google.com with SMTP id q127so6567904qkb.1 for ; Mon, 03 May 2021 14:00:15 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=gBJp2fdvTbw+QwStCVivUImNP5wBw5xFMUPTD5ObOdc=; b=rqkdT/fwuycJdFqF9J890cY2AcZEl/XzLWGDo93MiWgHlNM1KG7TiinCv/5zNLhXoM uvtOF4QLSeR0+a2FOxHf8FjsTSKzhdvBgFSVdJhUrlZkjLxb+5zzG3Sc3O7N/lZVdp5e xu/1SILyX6DoCULrrKcted/7XA0/eARa7Lf4ZkxdvMkJTQD+CYseGaQZvKvBL7IqB8Be sTn4ks4oMxiaXSUsOiegxmwHF4pZ6J+nAkrRXlGMEByaRnqkprKo5V2rZgp9L2CSMSBM Xd6/Ytlf2cWnlLtsAjfbPIoXXPXHzSxAi9MgZFol3gIvTMUCsF8nYi7D/w8uXdGFeJC4 82ZA== X-Gm-Message-State: AOAM531+dfvCdnp9/jeg0KdKNUnq7dvDLl2GVp9CrXSxt4GqfiuebTf3 p1fTuv9MGZq4/fgRwx6KAJK66Kt+WKNmKw== X-Google-Smtp-Source: ABdhPJyvGiR+Y4TdqK3erYesTQyduw81HcPvJITnyc00anoH/0b7fUS3tBjDuymBQbMXHaIso5em2Q== X-Received: by 2002:a05:620a:4451:: with SMTP id w17mr20359157qkp.59.1620075614533; Mon, 03 May 2021 14:00:14 -0700 (PDT) Received: from birita.. ([177.194.41.149]) by smtp.googlemail.com with ESMTPSA id w196sm4578090qkb.90.2021.05.03.14.00.13 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 03 May 2021 14:00:14 -0700 (PDT) To: libc-alpha@sourceware.org Subject: [PATCH v3 4/6] nptl: Move cancel state out of cancelhandling Date: Mon, 3 May 2021 18:00:03 -0300 Message-Id: <20210503210005.2891859-4-adhemerval.zanella@linaro.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210503210005.2891859-1-adhemerval.zanella@linaro.org> References: <20210503210005.2891859-1-adhemerval.zanella@linaro.org> MIME-Version: 1.0 X-Spam-Status: No, score=-12.6 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Adhemerval Zanella via Libc-alpha From: Adhemerval Zanella Reply-To: Adhemerval Zanella Errors-To: libc-alpha-bounces@sourceware.org Sender: "Libc-alpha" Changes from v2: * Rebased against master. Changes from v1: * Rebased against master. --- The thread cancellation state is not accessed concurrently internally neither the pthread interface allows changing the state of a different thread than its own. By removing the cancel state out of the internal thread cancel handling state there is no need to check if cancelled bit was set in CAS operation. The code is also simplified: the CANCELLATION_P is replaced with a internal pthread_testcancel call and the CANCELSTATE_BIT{MASK} is removed. The second part of this patchset also keeps the pthread_setcanceltype as cancellation entrypoint by calling pthread_testcancel if the new type is PTHREAD_CANCEL_ASYNCHRONOUS. With this behavior pthread_setcancelstate does not require to act on cancellation if cancel type is asynchronous (is already handled either by pthread_setcanceltype or by the signal handler). Checked on x86_64-linux-gnu. --- manual/pattern.texi | 1 - manual/process.texi | 3 +-- nptl/allocatestack.c | 1 + nptl/cancellation.c | 3 ++- nptl/cleanup_defer.c | 2 +- nptl/descr.h | 14 ++++++-------- nptl/libc-cleanup.c | 2 +- nptl/pthreadP.h | 12 ------------ nptl/pthread_cancel.c | 3 ++- nptl/pthread_join_common.c | 5 ++++- nptl/pthread_setcancelstate.c | 36 +++-------------------------------- nptl/pthread_setcanceltype.c | 3 ++- nptl/pthread_testcancel.c | 11 ++++++++++- 13 files changed, 33 insertions(+), 63 deletions(-) diff --git a/manual/pattern.texi b/manual/pattern.texi index 39ae97a3c4..4fa4c25525 100644 --- a/manual/pattern.texi +++ b/manual/pattern.texi @@ -1820,7 +1820,6 @@ the beginning of the vector. @c (disable cancellation around exec_comm; it may do_cancel the @c second time, if async cancel is enabled) @c THREAD_ATOMIC_CMPXCHG_VAL dup ok -@c CANCEL_ENABLED_AND_CANCELED_AND_ASYNCHRONOUS dup ok @c do_cancel @ascuplugin @ascuheap @acsmem @c THREAD_ATOMIC_BIT_SET dup ok @c pthread_unwind @ascuplugin @ascuheap @acsmem diff --git a/manual/process.texi b/manual/process.texi index 54e65f76c6..134d5c6143 100644 --- a/manual/process.texi +++ b/manual/process.texi @@ -68,7 +68,7 @@ until the subprogram terminates before you can do anything else. @c CLEANUP_HANDLER @ascuplugin @ascuheap @acsmem @c libc_cleanup_region_start @ascuplugin @ascuheap @acsmem @c pthread_cleanup_push_defer @ascuplugin @ascuheap @acsmem -@c CANCELLATION_P @ascuplugin @ascuheap @acsmem +@c __pthread_testcancel @ascuplugin @ascuheap @acsmem @c CANCEL_ENABLED_AND_CANCELED ok @c do_cancel @ascuplugin @ascuheap @acsmem @c cancel_handler ok @@ -86,7 +86,6 @@ until the subprogram terminates before you can do anything else. @c SINGLE_THREAD_P ok @c LIBC_CANCEL_ASYNC @ascuplugin @ascuheap @acsmem @c libc_enable_asynccancel @ascuplugin @ascuheap @acsmem -@c CANCEL_ENABLED_AND_CANCELED_AND_ASYNCHRONOUS dup ok @c do_cancel dup @ascuplugin @ascuheap @acsmem @c LIBC_CANCEL_RESET ok @c libc_disable_asynccancel ok diff --git a/nptl/allocatestack.c b/nptl/allocatestack.c index f1270c3109..eb25a2a034 100644 --- a/nptl/allocatestack.c +++ b/nptl/allocatestack.c @@ -219,6 +219,7 @@ get_cached_stack (size_t *sizep, void **memp) /* Cancellation handling is back to the default. */ result->cancelhandling = 0; + result->cancelstate = PTHREAD_CANCEL_ENABLE; result->cleanup = NULL; /* No pending event. */ diff --git a/nptl/cancellation.c b/nptl/cancellation.c index 2ee633eabc..1ba94860fe 100644 --- a/nptl/cancellation.c +++ b/nptl/cancellation.c @@ -45,7 +45,8 @@ __pthread_enable_asynccancel (void) oldval); if (__glibc_likely (curval == oldval)) { - if (CANCEL_ENABLED_AND_CANCELED_AND_ASYNCHRONOUS (newval)) + if (self->cancelstate == PTHREAD_CANCEL_ENABLE + && CANCEL_CANCELED_AND_ASYNCHRONOUS (newval)) { THREAD_SETMEM (self, result, PTHREAD_CANCELED); __do_cancel (); diff --git a/nptl/cleanup_defer.c b/nptl/cleanup_defer.c index 08271e352f..3f7efc939f 100644 --- a/nptl/cleanup_defer.c +++ b/nptl/cleanup_defer.c @@ -86,6 +86,6 @@ __pthread_unregister_cancel_restore (__pthread_unwind_buf_t *buf) cancelhandling = curval; } - CANCELLATION_P (self); + __pthread_testcancel (); } } diff --git a/nptl/descr.h b/nptl/descr.h index d423a53bbf..465af117e5 100644 --- a/nptl/descr.h +++ b/nptl/descr.h @@ -277,9 +277,6 @@ struct pthread /* Flags determining processing of cancellation. */ int cancelhandling; - /* Bit set if cancellation is disabled. */ -#define CANCELSTATE_BIT 0 -#define CANCELSTATE_BITMASK (0x01 << CANCELSTATE_BIT) /* Bit set if asynchronous cancellation mode is selected. */ #define CANCELTYPE_BIT 1 #define CANCELTYPE_BITMASK (0x01 << CANCELTYPE_BIT) @@ -301,11 +298,8 @@ struct pthread /* Mask for the rest. Helps the compiler to optimize. */ #define CANCEL_RESTMASK 0xffffff80 -#define CANCEL_ENABLED_AND_CANCELED(value) \ - (((value) & (CANCELSTATE_BITMASK | CANCELED_BITMASK | EXITING_BITMASK \ - | CANCEL_RESTMASK | TERMINATED_BITMASK)) == CANCELED_BITMASK) -#define CANCEL_ENABLED_AND_CANCELED_AND_ASYNCHRONOUS(value) \ - (((value) & (CANCELSTATE_BITMASK | CANCELTYPE_BITMASK | CANCELED_BITMASK \ +#define CANCEL_CANCELED_AND_ASYNCHRONOUS(value) \ + (((value) & (CANCELTYPE_BITMASK | CANCELED_BITMASK \ | EXITING_BITMASK | CANCEL_RESTMASK | TERMINATED_BITMASK)) \ == (CANCELTYPE_BITMASK | CANCELED_BITMASK)) @@ -409,6 +403,10 @@ struct pthread /* Used on strsignal. */ struct tls_internal_t tls_state; + /* Thread cancel state (PTHREAD_CANCEL_ENABLE or + PTHREAD_CANCEL_DISABLE). */ + unsigned char cancelstate; + /* This member must be last. */ char end_padding[]; diff --git a/nptl/libc-cleanup.c b/nptl/libc-cleanup.c index 14ccfe9285..6286b8b525 100644 --- a/nptl/libc-cleanup.c +++ b/nptl/libc-cleanup.c @@ -79,7 +79,7 @@ __libc_cleanup_pop_restore (struct _pthread_cleanup_buffer *buffer) cancelhandling = curval; } - CANCELLATION_P (self); + __pthread_testcancel (); } } libc_hidden_def (__libc_cleanup_pop_restore) diff --git a/nptl/pthreadP.h b/nptl/pthreadP.h index 4116970b77..7d2f33be0d 100644 --- a/nptl/pthreadP.h +++ b/nptl/pthreadP.h @@ -259,18 +259,6 @@ extern int __pthread_debug attribute_hidden; #endif -/* Cancellation test. */ -#define CANCELLATION_P(self) \ - do { \ - int cancelhandling = THREAD_GETMEM (self, cancelhandling); \ - if (CANCEL_ENABLED_AND_CANCELED (cancelhandling)) \ - { \ - THREAD_SETMEM (self, result, PTHREAD_CANCELED); \ - __do_cancel (); \ - } \ - } while (0) - - extern void __pthread_unwind (__pthread_unwind_buf_t *__buf) __cleanup_fct_attribute __attribute ((__noreturn__)) #if !defined SHARED && !IS_IN (libpthread) diff --git a/nptl/pthread_cancel.c b/nptl/pthread_cancel.c index 060484cdc8..b3dbf26843 100644 --- a/nptl/pthread_cancel.c +++ b/nptl/pthread_cancel.c @@ -64,7 +64,8 @@ __pthread_cancel (pthread_t th) /* If the cancellation is handled asynchronously just send a signal. We avoid this if possible since it's more expensive. */ - if (CANCEL_ENABLED_AND_CANCELED_AND_ASYNCHRONOUS (newval)) + if (pd->cancelstate == PTHREAD_CANCEL_ENABLE + && CANCEL_CANCELED_AND_ASYNCHRONOUS (newval)) { /* Mark the cancellation as "in progress". */ if (atomic_compare_and_exchange_bool_acq (&pd->cancelhandling, diff --git a/nptl/pthread_join_common.c b/nptl/pthread_join_common.c index a99c26e27e..e4efd83715 100644 --- a/nptl/pthread_join_common.c +++ b/nptl/pthread_join_common.c @@ -59,7 +59,10 @@ __pthread_clockjoin_ex (pthread_t threadid, void **thread_return, && (pd->cancelhandling & (CANCELING_BITMASK | CANCELED_BITMASK | EXITING_BITMASK | TERMINATED_BITMASK)) == 0)) - && !CANCEL_ENABLED_AND_CANCELED (self->cancelhandling)) + && !(self->cancelstate == PTHREAD_CANCEL_ENABLE + && (pd->cancelhandling & (CANCELED_BITMASK | EXITING_BITMASK + | TERMINATED_BITMASK)) + == CANCELED_BITMASK)) /* This is a deadlock situation. The threads are waiting for each other to finish. Note that this is a "may" error. To be 100% sure we catch this error we would have to lock the data diff --git a/nptl/pthread_setcancelstate.c b/nptl/pthread_setcancelstate.c index e3696ca348..7e2b6e4974 100644 --- a/nptl/pthread_setcancelstate.c +++ b/nptl/pthread_setcancelstate.c @@ -31,39 +31,9 @@ __pthread_setcancelstate (int state, int *oldstate) self = THREAD_SELF; - int oldval = THREAD_GETMEM (self, cancelhandling); - while (1) - { - int newval = (state == PTHREAD_CANCEL_DISABLE - ? oldval | CANCELSTATE_BITMASK - : oldval & ~CANCELSTATE_BITMASK); - - /* Store the old value. */ - if (oldstate != NULL) - *oldstate = ((oldval & CANCELSTATE_BITMASK) - ? PTHREAD_CANCEL_DISABLE : PTHREAD_CANCEL_ENABLE); - - /* Avoid doing unnecessary work. The atomic operation can - potentially be expensive if the memory has to be locked and - remote cache lines have to be invalidated. */ - if (oldval == newval) - break; - - /* Update the cancel handling word. This has to be done - atomically since other bits could be modified as well. */ - int curval = THREAD_ATOMIC_CMPXCHG_VAL (self, cancelhandling, newval, - oldval); - if (__glibc_likely (curval == oldval)) - { - if (CANCEL_ENABLED_AND_CANCELED_AND_ASYNCHRONOUS (newval)) - __do_cancel (); - - break; - } - - /* Prepare for the next round. */ - oldval = curval; - } + if (oldstate != NULL) + *oldstate = self->cancelstate; + self->cancelstate = state; return 0; } diff --git a/nptl/pthread_setcanceltype.c b/nptl/pthread_setcanceltype.c index 5f061d512b..ae5df1d591 100644 --- a/nptl/pthread_setcanceltype.c +++ b/nptl/pthread_setcanceltype.c @@ -53,7 +53,8 @@ __pthread_setcanceltype (int type, int *oldtype) oldval); if (__glibc_likely (curval == oldval)) { - if (CANCEL_ENABLED_AND_CANCELED_AND_ASYNCHRONOUS (newval)) + if (self->cancelstate == PTHREAD_CANCEL_ENABLE + && CANCEL_CANCELED_AND_ASYNCHRONOUS (newval)) { THREAD_SETMEM (self, result, PTHREAD_CANCELED); __do_cancel (); diff --git a/nptl/pthread_testcancel.c b/nptl/pthread_testcancel.c index b6964904bb..c0d22eb77c 100644 --- a/nptl/pthread_testcancel.c +++ b/nptl/pthread_testcancel.c @@ -24,7 +24,16 @@ void __pthread_testcancel (void) { - CANCELLATION_P (THREAD_SELF); + struct pthread *self = THREAD_SELF; + int cancelhandling = THREAD_GETMEM (self, cancelhandling); + if (self->cancelstate == PTHREAD_CANCEL_ENABLE + && (cancelhandling & CANCELED_BITMASK) + && !(cancelhandling & EXITING_BITMASK) + && !(cancelhandling & TERMINATED_BITMASK)) + { + THREAD_SETMEM (self, result, PTHREAD_CANCELED); + __do_cancel (); + } } libc_hidden_def (__pthread_testcancel) From patchwork Mon May 3 21:00:04 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adhemerval Zanella X-Patchwork-Id: 43240 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 A9B9839574C5; Mon, 3 May 2021 21:00:19 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org A9B9839574C5 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1620075619; bh=OukRUrbzJdSRBZYH/b24VI++CZHepPl9UGO445h+GJQ=; h=To:Subject:Date:In-Reply-To:References:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=pCOtxOskfCQzBXlwxRFznbzXoyivq/qafw9ZtHzHaWYTr4T5OnBIpvAMBo7T0IaCw +0fA3VswJ3ncnFeDXpJfgf2x5aEEJq+WOiCw7ORpChCv8XTASBG0/QJPKrvdRAts7/ 14BEiUpEeRZyxg+IsLLK91eUV46qO+IJWEqAM0Dk= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-qt1-x835.google.com (mail-qt1-x835.google.com [IPv6:2607:f8b0:4864:20::835]) by sourceware.org (Postfix) with ESMTPS id 1C34D39540D8 for ; Mon, 3 May 2021 21:00:17 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 1C34D39540D8 Received: by mail-qt1-x835.google.com with SMTP id a18so4790521qtj.10 for ; Mon, 03 May 2021 14:00:17 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=OukRUrbzJdSRBZYH/b24VI++CZHepPl9UGO445h+GJQ=; b=RRpZ0JI2vCZDXynrxOCrnClIlHaFN8VtdqOet2vS7ah4beguSC1BkuvrxtEGPDW5wE eNrv4iqjbdrw9NTCIFL37wRbVjEk9bGHgcc7HX0hdLB5ErNwQ1IQbd+zDU1YZjMvyD6p n9TX85QG6TH5krkSZlxyzUpX2PWrse1C2bKHFJbe4ESDn8E14n5N2APgB1lQLYQhwHFm zmO2lXahs8/OktoVFiuwmsQy7eG+9aW4yhTgnegGyl7creAtGwbW3VYDl/C5H8Km8HQb 2sLCinBbs8s/E+zqp79gzyfXXg9xX3x+rgGXzUGSMsP2UN9fJ7rrxEk9cLKRmXsDczme 6o7w== X-Gm-Message-State: AOAM532WsOjWFLy/9prNjRPDe4XwHcRcEAuSYAOmFVB8ssYeG08saGH8 K5DmlCsBt1L4Hd/KZmn2WyoZyxIBhjLI9g== X-Google-Smtp-Source: ABdhPJw7qi7AHE9LGWNIi2dFZGbTrkhxcvjuCLE8L/h1MeJgZJBp6/9MJoK23MFuXvjeVd/2zZ3SCg== X-Received: by 2002:ac8:548c:: with SMTP id h12mr19668521qtq.272.1620075615998; Mon, 03 May 2021 14:00:15 -0700 (PDT) Received: from birita.. ([177.194.41.149]) by smtp.googlemail.com with ESMTPSA id w196sm4578090qkb.90.2021.05.03.14.00.14 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 03 May 2021 14:00:15 -0700 (PDT) To: libc-alpha@sourceware.org Subject: [PATCH v3 5/6] nptl: Move cancel type out of cancelhandling Date: Mon, 3 May 2021 18:00:04 -0300 Message-Id: <20210503210005.2891859-5-adhemerval.zanella@linaro.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210503210005.2891859-1-adhemerval.zanella@linaro.org> References: <20210503210005.2891859-1-adhemerval.zanella@linaro.org> MIME-Version: 1.0 X-Spam-Status: No, score=-12.2 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, KAM_ASCII_DIVIDERS, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Adhemerval Zanella via Libc-alpha From: Adhemerval Zanella Reply-To: Adhemerval Zanella Errors-To: libc-alpha-bounces@sourceware.org Sender: "Libc-alpha" Changes from v2: * Rebased against master. Changes from v1: * Rebased against master. --- The thread cancellation type is not accessed concurrently internally neither its pthread interface allows changing the state of a different thread than its own. By removing the cancel state out of the internal thread cancel handling state there is no need to check if cancelled bit was set in CAS operation. It allows simplifing the cancellation wrappers and the CANCEL_CANCELED_AND_ASYNCHRONOUS is removed. Checked on x86_64-linux-gnu. --- nptl/allocatestack.c | 1 + nptl/cancellation.c | 60 ++++++++++-------------------------- nptl/cleanup_defer.c | 46 +++------------------------ nptl/descr.h | 14 +++------ nptl/libc-cleanup.c | 44 +++----------------------- nptl/nptl-init.c | 2 +- nptl/pthread_cancel.c | 5 ++- nptl/pthread_setcanceltype.c | 42 +++---------------------- 8 files changed, 41 insertions(+), 173 deletions(-) diff --git a/nptl/allocatestack.c b/nptl/allocatestack.c index eb25a2a034..53444e2870 100644 --- a/nptl/allocatestack.c +++ b/nptl/allocatestack.c @@ -220,6 +220,7 @@ get_cached_stack (size_t *sizep, void **memp) /* Cancellation handling is back to the default. */ result->cancelhandling = 0; result->cancelstate = PTHREAD_CANCEL_ENABLE; + result->canceltype = PTHREAD_CANCEL_DEFERRED; result->cleanup = NULL; /* No pending event. */ diff --git a/nptl/cancellation.c b/nptl/cancellation.c index 1ba94860fe..d039f424fb 100644 --- a/nptl/cancellation.c +++ b/nptl/cancellation.c @@ -32,31 +32,19 @@ attribute_hidden __pthread_enable_asynccancel (void) { struct pthread *self = THREAD_SELF; - int oldval = THREAD_GETMEM (self, cancelhandling); - while (1) - { - int newval = oldval | CANCELTYPE_BITMASK; - - if (newval == oldval) - break; - - int curval = THREAD_ATOMIC_CMPXCHG_VAL (self, cancelhandling, newval, - oldval); - if (__glibc_likely (curval == oldval)) - { - if (self->cancelstate == PTHREAD_CANCEL_ENABLE - && CANCEL_CANCELED_AND_ASYNCHRONOUS (newval)) - { - THREAD_SETMEM (self, result, PTHREAD_CANCELED); - __do_cancel (); - } + int oldval = THREAD_GETMEM (self, canceltype); + THREAD_SETMEM (self, canceltype, PTHREAD_CANCEL_ASYNCHRONOUS); - break; - } + int ch = THREAD_GETMEM (self, cancelhandling); - /* Prepare the next round. */ - oldval = curval; + if (self->cancelstate == PTHREAD_CANCEL_ENABLE + && (ch & CANCELED_BITMASK) + && !(ch & EXITING_BITMASK) + && !(ch & TERMINATED_BITMASK)) + { + THREAD_SETMEM (self, result, PTHREAD_CANCELED); + __do_cancel (); } return oldval; @@ -70,36 +58,22 @@ __pthread_disable_asynccancel (int oldtype) { /* If asynchronous cancellation was enabled before we do not have anything to do. */ - if (oldtype & CANCELTYPE_BITMASK) + if (oldtype == PTHREAD_CANCEL_ASYNCHRONOUS) return; struct pthread *self = THREAD_SELF; - int newval; - - int oldval = THREAD_GETMEM (self, cancelhandling); - - while (1) - { - newval = oldval & ~CANCELTYPE_BITMASK; - - int curval = THREAD_ATOMIC_CMPXCHG_VAL (self, cancelhandling, newval, - oldval); - if (__glibc_likely (curval == oldval)) - break; - - /* Prepare the next round. */ - oldval = curval; - } + THREAD_SETMEM (self, canceltype, PTHREAD_CANCEL_DEFERRED); /* We cannot return when we are being canceled. Upon return the thread might be things which would have to be undone. The following loop should loop until the cancellation signal is delivered. */ - while (__builtin_expect ((newval & (CANCELING_BITMASK | CANCELED_BITMASK)) - == CANCELING_BITMASK, 0)) + int ch = THREAD_GETMEM (self, cancelhandling); + while (__glibc_unlikely ((ch & CANCELING_BITMASK) + && !(ch & CANCELED_BITMASK))) { - futex_wait_simple ((unsigned int *) &self->cancelhandling, newval, + futex_wait_simple ((unsigned int *) &self->cancelhandling, ch, FUTEX_PRIVATE); - newval = THREAD_GETMEM (self, cancelhandling); + ch = THREAD_GETMEM (self, cancelhandling); } } diff --git a/nptl/cleanup_defer.c b/nptl/cleanup_defer.c index 3f7efc939f..8a41069ebf 100644 --- a/nptl/cleanup_defer.c +++ b/nptl/cleanup_defer.c @@ -31,27 +31,9 @@ __pthread_register_cancel_defer (__pthread_unwind_buf_t *buf) ibuf->priv.data.prev = THREAD_GETMEM (self, cleanup_jmp_buf); ibuf->priv.data.cleanup = THREAD_GETMEM (self, cleanup); - int cancelhandling = THREAD_GETMEM (self, cancelhandling); - /* Disable asynchronous cancellation for now. */ - if (__glibc_unlikely (cancelhandling & CANCELTYPE_BITMASK)) - while (1) - { - int curval = THREAD_ATOMIC_CMPXCHG_VAL (self, cancelhandling, - cancelhandling - & ~CANCELTYPE_BITMASK, - cancelhandling); - if (__glibc_likely (curval == cancelhandling)) - /* Successfully replaced the value. */ - break; - - /* Prepare for the next round. */ - cancelhandling = curval; - } - - ibuf->priv.data.canceltype = (cancelhandling & CANCELTYPE_BITMASK - ? PTHREAD_CANCEL_ASYNCHRONOUS - : PTHREAD_CANCEL_DEFERRED); + ibuf->priv.data.canceltype = THREAD_GETMEM (self, canceltype); + THREAD_SETMEM (self, canceltype, PTHREAD_CANCEL_DEFERRED); /* Store the new cleanup handler info. */ THREAD_SETMEM (self, cleanup_jmp_buf, (struct pthread_unwind_buf *) buf); @@ -67,25 +49,7 @@ __pthread_unregister_cancel_restore (__pthread_unwind_buf_t *buf) THREAD_SETMEM (self, cleanup_jmp_buf, ibuf->priv.data.prev); - int cancelhandling; - if (ibuf->priv.data.canceltype != PTHREAD_CANCEL_DEFERRED - && ((cancelhandling = THREAD_GETMEM (self, cancelhandling)) - & CANCELTYPE_BITMASK) == 0) - { - while (1) - { - int curval = THREAD_ATOMIC_CMPXCHG_VAL (self, cancelhandling, - cancelhandling - | CANCELTYPE_BITMASK, - cancelhandling); - if (__glibc_likely (curval == cancelhandling)) - /* Successfully replaced the value. */ - break; - - /* Prepare for the next round. */ - cancelhandling = curval; - } - - __pthread_testcancel (); - } + THREAD_SETMEM (self, canceltype, ibuf->priv.data.canceltype); + if (ibuf->priv.data.canceltype == PTHREAD_CANCEL_ASYNCHRONOUS) + __pthread_testcancel (); } diff --git a/nptl/descr.h b/nptl/descr.h index 465af117e5..8ef877b1cd 100644 --- a/nptl/descr.h +++ b/nptl/descr.h @@ -277,9 +277,6 @@ struct pthread /* Flags determining processing of cancellation. */ int cancelhandling; - /* Bit set if asynchronous cancellation mode is selected. */ -#define CANCELTYPE_BIT 1 -#define CANCELTYPE_BITMASK (0x01 << CANCELTYPE_BIT) /* Bit set if canceling has been initiated. */ #define CANCELING_BIT 2 #define CANCELING_BITMASK (0x01 << CANCELING_BIT) @@ -295,13 +292,6 @@ struct pthread /* Bit set if thread is supposed to change XID. */ #define SETXID_BIT 6 #define SETXID_BITMASK (0x01 << SETXID_BIT) - /* Mask for the rest. Helps the compiler to optimize. */ -#define CANCEL_RESTMASK 0xffffff80 - -#define CANCEL_CANCELED_AND_ASYNCHRONOUS(value) \ - (((value) & (CANCELTYPE_BITMASK | CANCELED_BITMASK \ - | EXITING_BITMASK | CANCEL_RESTMASK | TERMINATED_BITMASK)) \ - == (CANCELTYPE_BITMASK | CANCELED_BITMASK)) /* Flags. Including those copied from the thread attribute. */ int flags; @@ -407,6 +397,10 @@ struct pthread PTHREAD_CANCEL_DISABLE). */ unsigned char cancelstate; + /* Thread cancel type (PTHREAD_CANCEL_DEFERRED or + PTHREAD_CANCEL_ASYNCHRONOUS). */ + unsigned char canceltype; + /* This member must be last. */ char end_padding[]; diff --git a/nptl/libc-cleanup.c b/nptl/libc-cleanup.c index 6286b8b525..180d15bc9e 100644 --- a/nptl/libc-cleanup.c +++ b/nptl/libc-cleanup.c @@ -27,27 +27,9 @@ __libc_cleanup_push_defer (struct _pthread_cleanup_buffer *buffer) buffer->__prev = THREAD_GETMEM (self, cleanup); - int cancelhandling = THREAD_GETMEM (self, cancelhandling); - /* Disable asynchronous cancellation for now. */ - if (__glibc_unlikely (cancelhandling & CANCELTYPE_BITMASK)) - while (1) - { - int curval = THREAD_ATOMIC_CMPXCHG_VAL (self, cancelhandling, - cancelhandling - & ~CANCELTYPE_BITMASK, - cancelhandling); - if (__glibc_likely (curval == cancelhandling)) - /* Successfully replaced the value. */ - break; - - /* Prepare for the next round. */ - cancelhandling = curval; - } - - buffer->__canceltype = (cancelhandling & CANCELTYPE_BITMASK - ? PTHREAD_CANCEL_ASYNCHRONOUS - : PTHREAD_CANCEL_DEFERRED); + buffer->__canceltype = THREAD_GETMEM (self, canceltype); + THREAD_SETMEM (self, canceltype, PTHREAD_CANCEL_DEFERRED); THREAD_SETMEM (self, cleanup, buffer); } @@ -60,26 +42,8 @@ __libc_cleanup_pop_restore (struct _pthread_cleanup_buffer *buffer) THREAD_SETMEM (self, cleanup, buffer->__prev); - int cancelhandling; - if (__builtin_expect (buffer->__canceltype != PTHREAD_CANCEL_DEFERRED, 0) - && ((cancelhandling = THREAD_GETMEM (self, cancelhandling)) - & CANCELTYPE_BITMASK) == 0) - { - while (1) - { - int curval = THREAD_ATOMIC_CMPXCHG_VAL (self, cancelhandling, - cancelhandling - | CANCELTYPE_BITMASK, - cancelhandling); - if (__glibc_likely (curval == cancelhandling)) - /* Successfully replaced the value. */ - break; - - /* Prepare for the next round. */ - cancelhandling = curval; - } - + THREAD_SETMEM (self, canceltype, buffer->__canceltype); + if (buffer->__canceltype == PTHREAD_CANCEL_ASYNCHRONOUS) __pthread_testcancel (); - } } libc_hidden_def (__libc_cleanup_pop_restore) diff --git a/nptl/nptl-init.c b/nptl/nptl-init.c index b0879bd87e..82f0284979 100644 --- a/nptl/nptl-init.c +++ b/nptl/nptl-init.c @@ -84,7 +84,7 @@ sigcancel_handler (int sig, siginfo_t *si, void *ctx) THREAD_SETMEM (self, result, PTHREAD_CANCELED); /* Make sure asynchronous cancellation is still enabled. */ - if ((newval & CANCELTYPE_BITMASK) != 0) + if (self->canceltype == PTHREAD_CANCEL_ASYNCHRONOUS) /* Run the registered destructors and terminate the thread. */ __do_cancel (); diff --git a/nptl/pthread_cancel.c b/nptl/pthread_cancel.c index b3dbf26843..d48d04881c 100644 --- a/nptl/pthread_cancel.c +++ b/nptl/pthread_cancel.c @@ -65,7 +65,10 @@ __pthread_cancel (pthread_t th) signal. We avoid this if possible since it's more expensive. */ if (pd->cancelstate == PTHREAD_CANCEL_ENABLE - && CANCEL_CANCELED_AND_ASYNCHRONOUS (newval)) + && pd->canceltype == PTHREAD_CANCEL_ASYNCHRONOUS + && (newval & CANCELED_BITMASK) + && !(newval & EXITING_BITMASK) + && !(newval & TERMINATED_BITMASK)) { /* Mark the cancellation as "in progress". */ if (atomic_compare_and_exchange_bool_acq (&pd->cancelhandling, diff --git a/nptl/pthread_setcanceltype.c b/nptl/pthread_setcanceltype.c index ae5df1d591..e7b24ae733 100644 --- a/nptl/pthread_setcanceltype.c +++ b/nptl/pthread_setcanceltype.c @@ -29,43 +29,11 @@ __pthread_setcanceltype (int type, int *oldtype) volatile struct pthread *self = THREAD_SELF; - int oldval = THREAD_GETMEM (self, cancelhandling); - while (1) - { - int newval = (type == PTHREAD_CANCEL_ASYNCHRONOUS - ? oldval | CANCELTYPE_BITMASK - : oldval & ~CANCELTYPE_BITMASK); - - /* Store the old value. */ - if (oldtype != NULL) - *oldtype = ((oldval & CANCELTYPE_BITMASK) - ? PTHREAD_CANCEL_ASYNCHRONOUS : PTHREAD_CANCEL_DEFERRED); - - /* Avoid doing unnecessary work. The atomic operation can - potentially be expensive if the memory has to be locked and - remote cache lines have to be invalidated. */ - if (oldval == newval) - break; - - /* Update the cancel handling word. This has to be done - atomically since other bits could be modified as well. */ - int curval = THREAD_ATOMIC_CMPXCHG_VAL (self, cancelhandling, newval, - oldval); - if (__glibc_likely (curval == oldval)) - { - if (self->cancelstate == PTHREAD_CANCEL_ENABLE - && CANCEL_CANCELED_AND_ASYNCHRONOUS (newval)) - { - THREAD_SETMEM (self, result, PTHREAD_CANCELED); - __do_cancel (); - } - - break; - } - - /* Prepare for the next round. */ - oldval = curval; - } + if (oldtype != NULL) + *oldtype = self->canceltype; + self->canceltype = type; + if (type == PTHREAD_CANCEL_ASYNCHRONOUS) + __pthread_testcancel (); return 0; } From patchwork Mon May 3 21:00:05 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adhemerval Zanella X-Patchwork-Id: 43242 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 1107B3958C03; Mon, 3 May 2021 21:00:23 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 1107B3958C03 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1620075623; bh=BkayxVZyH3ixzLYPlVCwYPbxIlZPgyyoTHQsPG6tKiU=; h=To:Subject:Date:In-Reply-To:References:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=p02R3GiM1i6c6X0OqCuRjO6KPr/xRPmP/14v8BWJhMRAqCpK7PfQ9YWrYjdRFn5+1 oJ2DNqH08vAmnAYQ6MdqaK+7i03A5GX1IIno8u91kRQ/+W8cAkwINxIXk4k2y332MC YJ1k5IzFzapdx1b0DbeOuCrD3vELxHTxveGiaDgM= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-qv1-xf35.google.com (mail-qv1-xf35.google.com [IPv6:2607:f8b0:4864:20::f35]) by sourceware.org (Postfix) with ESMTPS id DA75F3957425 for ; Mon, 3 May 2021 21:00:17 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org DA75F3957425 Received: by mail-qv1-xf35.google.com with SMTP id j3so3370333qvs.1 for ; Mon, 03 May 2021 14:00:17 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=BkayxVZyH3ixzLYPlVCwYPbxIlZPgyyoTHQsPG6tKiU=; b=UYlsYxVpELeyd/GFSLJ5lRi/ME+oe+lgWoyTYqbXBJP2s1zHnewYTJVFHsTvWRFLoH nYk0YzsIf+gC1G9jB/6zhNXls4P8uoBoZfKzeLU96d5SjT5h1zZjtJn0F0dnS6G5jo3R Ze/+91XQ0ntJO9ZeqiXgGTDXudkE57qaT8H4eaVgFJbCu1v7hnJTI52rYww0GZYvjFqg VxRkQuWi/LMh5DGycQREp4zy708Oty+DzDdS1omci6FZBgSEjMExwcTq5LX4Z4Rizr5I d427M9TZYYfYdZB4fxaHXv2F5c/BZDbGHN/XRMNPgWcHzLlg0BVnienxjbNh+Uittkwa s4+g== X-Gm-Message-State: AOAM533IAAWkGd6uxo3t+cRkzlP/4jAFcM/TpDo//9U0QVOdyJM3cCmt Lugc3j16N4XkIocp4r9v6rLOLa8Whd2ssw== X-Google-Smtp-Source: ABdhPJxY26xpLyjER8ioZ/TI7CljH4kY3DEjpJKh5knQaOXFC7n1Bd2hTUVPWD6PBv5Z+bbZWHf7/A== X-Received: by 2002:a05:6214:248e:: with SMTP id gi14mr5483959qvb.7.1620075617244; Mon, 03 May 2021 14:00:17 -0700 (PDT) Received: from birita.. ([177.194.41.149]) by smtp.googlemail.com with ESMTPSA id w196sm4578090qkb.90.2021.05.03.14.00.16 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 03 May 2021 14:00:17 -0700 (PDT) To: libc-alpha@sourceware.org Subject: [PATCH v3 6/6] nptl: Use pthread_kill on pthread_cancel Date: Mon, 3 May 2021 18:00:05 -0300 Message-Id: <20210503210005.2891859-6-adhemerval.zanella@linaro.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210503210005.2891859-1-adhemerval.zanella@linaro.org> References: <20210503210005.2891859-1-adhemerval.zanella@linaro.org> MIME-Version: 1.0 X-Spam-Status: No, score=-12.6 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Adhemerval Zanella via Libc-alpha From: Adhemerval Zanella Reply-To: Adhemerval Zanella Errors-To: libc-alpha-bounces@sourceware.org Sender: "Libc-alpha" Changes from v2: * Rebased against master. --- It consolidates the tgkill call and it is the first step of making pthread_cancel async-signal-safe. Checked on x86_64-linux-gnu. --- nptl/Versions | 2 ++ nptl/pthreadP.h | 2 ++ nptl/pthread_cancel.c | 7 +------ nptl/pthread_kill.c | 19 +++++++++++++------ 4 files changed, 18 insertions(+), 12 deletions(-) diff --git a/nptl/Versions b/nptl/Versions index b0c575e30f..42a07c9ca3 100644 --- a/nptl/Versions +++ b/nptl/Versions @@ -291,6 +291,8 @@ libc { __pthread_testcancel; __sched_fifo_max_prio; __sched_fifo_min_prio; + # Used for thread cancellation. + __pthread_kill_internal; } } diff --git a/nptl/pthreadP.h b/nptl/pthreadP.h index 7d2f33be0d..ee92217598 100644 --- a/nptl/pthreadP.h +++ b/nptl/pthreadP.h @@ -552,6 +552,8 @@ extern int __pthread_equal (pthread_t thread1, pthread_t thread2); extern int __pthread_detach (pthread_t th); extern int __pthread_cancel (pthread_t th); libc_hidden_proto (__pthread_kill) +extern int __pthread_kill_internal (pthread_t threadid, int signo); +libc_hidden_proto (__pthread_kill_internal); extern void __pthread_exit (void *value) __attribute__ ((__noreturn__)); libc_hidden_proto (__pthread_exit) extern int __pthread_join (pthread_t threadid, void **thread_return); diff --git a/nptl/pthread_cancel.c b/nptl/pthread_cancel.c index d48d04881c..8dc1f23fdb 100644 --- a/nptl/pthread_cancel.c +++ b/nptl/pthread_cancel.c @@ -78,12 +78,7 @@ __pthread_cancel (pthread_t th) /* The cancellation handler will take care of marking the thread as canceled. */ - pid_t pid = __getpid (); - - int val = INTERNAL_SYSCALL_CALL (tgkill, pid, pd->tid, - SIGCANCEL); - if (INTERNAL_SYSCALL_ERROR_P (val)) - result = INTERNAL_SYSCALL_ERRNO (val); + __pthread_kill_internal (th, SIGCANCEL); break; } diff --git a/nptl/pthread_kill.c b/nptl/pthread_kill.c index d79531c10c..b1411f46b6 100644 --- a/nptl/pthread_kill.c +++ b/nptl/pthread_kill.c @@ -21,13 +21,8 @@ #include int -__pthread_kill (pthread_t threadid, int signo) +__pthread_kill_internal (pthread_t threadid, int signo) { - /* Disallow sending the signal we use for cancellation, timers, - for the setxid implementation. */ - if (__is_internal_signal (signo)) - return EINVAL; - sigset_t set; __libc_signal_block_all (&set); @@ -58,6 +53,18 @@ __pthread_kill (pthread_t threadid, int signo) return val; } +libc_hidden_def (__pthread_kill_internal) + +int +__pthread_kill (pthread_t threadid, int signo) +{ + /* Disallow sending the signal we use for cancellation, timers, + for the setxid implementation. */ + if (__is_internal_signal (signo)) + return EINVAL; + + return __pthread_kill_internal (threadid, signo); +} /* Some architectures (for instance arm) might pull raise through libgcc, so avoid the symbol version if it ends up being used on ld.so. */ #if !IS_IN(rtld)