1
0
mirror of https://sourceware.org/git/glibc.git synced 2025-07-29 11:41:21 +03:00

nptl: Export __libc_multiple_threads from libc as an internal symbol

This allows the elimination of the __libc_multiple_threads_ptr
variable in libpthread and its initialization procedure.

Tested-by: Carlos O'Donell <carlos@redhat.com>
Reviewed-by: Carlos O'Donell <carlos@redhat.com>
This commit is contained in:
Florian Weimer
2021-05-10 10:31:41 +02:00
parent d6163dfd38
commit 321789f61a
8 changed files with 13 additions and 30 deletions

View File

@ -27,9 +27,13 @@
The ABI might define SINGLE_THREAD_BY_GLOBAL to enable the single thread
check to use global variables instead of the pthread_t field. */
#ifndef __ASSEMBLER__
extern int __libc_multiple_threads;
libc_hidden_proto (__libc_multiple_threads)
#endif
#ifdef SINGLE_THREAD_BY_GLOBAL
# if IS_IN (libc)
extern int __libc_multiple_threads;
# define SINGLE_THREAD_P \
__glibc_likely (__libc_multiple_threads == 0)
# elif IS_IN (libpthread)