From patchwork Thu May 6 18:10:29 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Florian Weimer X-Patchwork-Id: 43276 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 21D9E3AAB45B; Thu, 6 May 2021 18:10:41 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 21D9E3AAB45B DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1620324641; bh=2jmkBJ2EfbYk9eySEiDJkPJxjausBLQzSa8bSOuFrZc=; h=To:Subject:In-Reply-To:References:Date:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=BMZI2cE5SQ9szefmQqlCnfV6tyA4JNgO68uxog5NLhrY1LF9xfHmRRyURBa38GPbB YxNSL4jSQSCl3zaBnHdWBFzHoFhFJgEMTTdGSFy845kDB+Ka3z/j6F1xjWCGXGJmVS oJ7HkUhqt3NLTeYIrW8motX5s6+ojtPF1EGpFmG8= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by sourceware.org (Postfix) with ESMTP id 81D8D3AAB45B for ; Thu, 6 May 2021 18:10:38 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 81D8D3AAB45B Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-451-oU3n-zyXMkCvKXCnpF28LA-1; Thu, 06 May 2021 14:10:32 -0400 X-MC-Unique: oU3n-zyXMkCvKXCnpF28LA-1 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id AD1B61088FEF for ; Thu, 6 May 2021 18:10:11 +0000 (UTC) Received: from oldenburg.str.redhat.com (ovpn-112-137.ams2.redhat.com [10.36.112.137]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 0EA916091A for ; Thu, 6 May 2021 18:10:10 +0000 (UTC) To: libc-alpha@sourceware.org Subject: [PATCH 06/13] nptl: Eliminate __pthread_multiple_threads In-Reply-To: References: Message-Id: <831eb2a40a5afc5ed198da0f5252efe9a50d9c2b.1620323953.git.fweimer@redhat.com> Date: Thu, 06 May 2021 20:10:29 +0200 User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-Spam-Status: No, score=-12.8 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H4, RCVD_IN_MSPIKE_WL, 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: Florian Weimer via Libc-alpha From: Florian Weimer Reply-To: Florian Weimer Errors-To: libc-alpha-bounces@sourceware.org Sender: "Libc-alpha" It is no longer needed after the SINGLE_THREADED_P consolidation. Tested-by: Carlos O'Donell Reviewed-by: Carlos O'Donell --- nptl/allocatestack.c | 4 ++-- nptl/pthreadP.h | 7 ------- nptl/pthread_cancel.c | 2 +- nptl/vars.c | 7 ------- 4 files changed, 3 insertions(+), 17 deletions(-) diff --git a/nptl/allocatestack.c b/nptl/allocatestack.c index 059786192e..88c49f8154 100644 --- a/nptl/allocatestack.c +++ b/nptl/allocatestack.c @@ -477,7 +477,7 @@ allocate_stack (const struct pthread_attr *attr, struct pthread **pdp, /* This is at least the second thread. */ pd->header.multiple_threads = 1; #ifndef TLS_MULTIPLE_THREADS_IN_TCB - __pthread_multiple_threads = __libc_multiple_threads = 1; + __libc_multiple_threads = 1; #endif #ifdef NEED_DL_SYSINFO @@ -598,7 +598,7 @@ allocate_stack (const struct pthread_attr *attr, struct pthread **pdp, /* This is at least the second thread. */ pd->header.multiple_threads = 1; #ifndef TLS_MULTIPLE_THREADS_IN_TCB - __pthread_multiple_threads = __libc_multiple_threads = 1; + __libc_multiple_threads = 1; #endif #ifdef NEED_DL_SYSINFO diff --git a/nptl/pthreadP.h b/nptl/pthreadP.h index dd6d6c6342..8ab247f977 100644 --- a/nptl/pthreadP.h +++ b/nptl/pthreadP.h @@ -370,13 +370,6 @@ extern unsigned long int *__fork_generation_pointer attribute_hidden; /* Register the generation counter in the libpthread with the libc. */ extern void __libc_pthread_init (void (*reclaim) (void)); -#ifndef TLS_MULTIPLE_THREADS_IN_TCB -/* Variable set to a nonzero value either if more than one thread runs or ran, - or if a single-threaded process is trying to cancel itself. See - nptl/descr.h for more context on the single-threaded process case. */ -extern int __pthread_multiple_threads attribute_hidden; -#endif - extern size_t __pthread_get_minstack (const pthread_attr_t *attr); /* Namespace save aliases. */ diff --git a/nptl/pthread_cancel.c b/nptl/pthread_cancel.c index 2cab8f0a34..fd04bedf6c 100644 --- a/nptl/pthread_cancel.c +++ b/nptl/pthread_cancel.c @@ -90,7 +90,7 @@ __pthread_cancel (pthread_t th) points get executed. */ THREAD_SETMEM (THREAD_SELF, header.multiple_threads, 1); #ifndef TLS_MULTIPLE_THREADS_IN_TCB - __pthread_multiple_threads = __libc_multiple_threads = 1; + __libc_multiple_threads = 1; #endif } /* Mark the thread as canceled. This has to be done diff --git a/nptl/vars.c b/nptl/vars.c index 8de30856b8..03a6cc84be 100644 --- a/nptl/vars.c +++ b/nptl/vars.c @@ -26,10 +26,3 @@ union pthread_attr_transparent __default_pthread_attr attribute_hidden; /* Mutex protecting __default_pthread_attr. */ int __default_pthread_attr_lock = LLL_LOCK_INITIALIZER; - -#ifndef TLS_MULTIPLE_THREADS_IN_TCB -/* Variable set to a nonzero value either if more than one thread runs or ran, - or if a single-threaded process is trying to cancel itself. See - nptl/descr.h for more context on the single-threaded process case. */ -int __pthread_multiple_threads attribute_hidden; -#endif