From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2178) id 9C6C5395B803; Mon, 10 May 2021 08:39:02 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 9C6C5395B803 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: Florian Weimer To: glibc-cvs@sourceware.org Subject: [glibc] nptl: Eliminate __pthread_multiple_threads X-Act-Checkin: glibc X-Git-Author: Florian Weimer X-Git-Refname: refs/heads/master X-Git-Oldrev: 29d4d1be681fee2fa7cf23205b6d993a3b2a4566 X-Git-Newrev: 0df5d8d404fbf6a7802737b0f9d32ab3376cec86 Message-Id: <20210510083902.9C6C5395B803@sourceware.org> Date: Mon, 10 May 2021 08:39:02 +0000 (GMT) X-BeenThere: glibc-cvs@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Glibc-cvs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 10 May 2021 08:39:02 -0000 https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=0df5d8d404fbf6a7802737b0f9d32ab3376cec86 commit 0df5d8d404fbf6a7802737b0f9d32ab3376cec86 Author: Florian Weimer Date: Mon May 10 10:31:41 2021 +0200 nptl: Eliminate __pthread_multiple_threads It is no longer needed after the SINGLE_THREADED_P consolidation. Tested-by: Carlos O'Donell Reviewed-by: Carlos O'Donell Diff: --- 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