mirror of
https://sourceware.org/git/glibc.git
synced 2024-11-23 17:53:37 +08:00
520a588705
While originally this definition was indeed used to distinguish between the cases where the GSCOPE flag was stored in TCB or not, it has since become used as a general way to distinguish between HTL and NPTL. THREAD_GSCOPE_IN_TCB will be removed in the following commits, as HTL, which currently is the only port that does not put the flag into TCB, will get ported to put the GSCOPE flag into the TCB as well. To prepare for that change, migrate all code that wants to distinguish between HTL and NPTL to use PTHREAD_IN_LIBC instead, which is a better choice since the distinction mostly has to do with whether libc has access to the list of thread structures and therefore can initialize thread-local storage. The parts of code that actually depend on whether the GSCOPE flag is in TCB are left unchanged. Signed-off-by: Sergey Bugaev <bugaevc@gmail.com> Message-Id: <20210907133325.255690-2-bugaevc@gmail.com> Reviewed-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
54 lines
1.6 KiB
C
54 lines
1.6 KiB
C
/* Completion of TCB initialization after TLS_INIT_TP. Generic version.
|
|
Copyright (C) 2021 Free Software Foundation, Inc.
|
|
This file is part of the GNU C Library.
|
|
|
|
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
|
|
<https://www.gnu.org/licenses/>. */
|
|
|
|
#include <ldsodefs.h>
|
|
|
|
#if defined SHARED && defined _LIBC_REENTRANT \
|
|
&& defined __rtld_lock_default_lock_recursive
|
|
static void
|
|
rtld_lock_default_lock_recursive (void *lock)
|
|
{
|
|
__rtld_lock_default_lock_recursive (lock);
|
|
}
|
|
|
|
static void
|
|
rtld_lock_default_unlock_recursive (void *lock)
|
|
{
|
|
__rtld_lock_default_unlock_recursive (lock);
|
|
}
|
|
#endif
|
|
|
|
void
|
|
__tls_pre_init_tp (void)
|
|
{
|
|
#if !PTHREAD_IN_LIBC
|
|
GL(dl_init_static_tls) = &_dl_nothread_init_static_tls;
|
|
#endif
|
|
|
|
#if defined SHARED && defined _LIBC_REENTRANT \
|
|
&& defined __rtld_lock_default_lock_recursive
|
|
GL(dl_rtld_lock_recursive) = rtld_lock_default_lock_recursive;
|
|
GL(dl_rtld_unlock_recursive) = rtld_lock_default_unlock_recursive;
|
|
#endif
|
|
}
|
|
|
|
void
|
|
__tls_init_tp (void)
|
|
{
|
|
}
|