mirror of
https://sourceware.org/git/glibc.git
synced 2025-08-08 17:42:12 +03:00
nptl: Move lowlevellock into libc [BZ #15648]
And export __lll_lock_wait and __lll_lock_wait_private as GLIBC_PRIVATE. This should eliminate the need for the previous riscv kludge.
This commit is contained in:
@@ -33,9 +33,9 @@ routines = \
|
|||||||
forward \
|
forward \
|
||||||
libc-cancellation \
|
libc-cancellation \
|
||||||
libc-cleanup \
|
libc-cleanup \
|
||||||
libc-lowlevellock \
|
|
||||||
libc_multiple_threads \
|
libc_multiple_threads \
|
||||||
libc_pthread_init \
|
libc_pthread_init \
|
||||||
|
lowlevellock \
|
||||||
old_pthread_cond_destroy \
|
old_pthread_cond_destroy \
|
||||||
old_pthread_cond_init \
|
old_pthread_cond_init \
|
||||||
pthread_atfork \
|
pthread_atfork \
|
||||||
@@ -100,7 +100,6 @@ libpthread-routines = \
|
|||||||
futex-internal \
|
futex-internal \
|
||||||
herrno \
|
herrno \
|
||||||
libpthread-compat \
|
libpthread-compat \
|
||||||
lowlevellock \
|
|
||||||
nptl-init \
|
nptl-init \
|
||||||
nptlfreeres \
|
nptlfreeres \
|
||||||
old_pthread_atfork \
|
old_pthread_atfork \
|
||||||
|
@@ -77,6 +77,8 @@ libc {
|
|||||||
__libc_current_sigrtmin_private;
|
__libc_current_sigrtmin_private;
|
||||||
__libc_dl_error_tsd;
|
__libc_dl_error_tsd;
|
||||||
__libc_pthread_init;
|
__libc_pthread_init;
|
||||||
|
__lll_lock_wait;
|
||||||
|
__lll_lock_wait_private;
|
||||||
__pthread_attr_copy;
|
__pthread_attr_copy;
|
||||||
__pthread_attr_destroy;
|
__pthread_attr_destroy;
|
||||||
__pthread_attr_init;
|
__pthread_attr_init;
|
||||||
|
@@ -1,20 +0,0 @@
|
|||||||
/* Copyright (C) 2003-2021 Free Software Foundation, Inc.
|
|
||||||
This file is part of the GNU C Library.
|
|
||||||
Contributed by Paul Mackerras <paulus@au.ibm.com>, 2003.
|
|
||||||
|
|
||||||
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/>. */
|
|
||||||
|
|
||||||
/* No difference to lowlevellock.c, except we lose a couple of functions. */
|
|
||||||
#include <lowlevellock.c>
|
|
@@ -35,10 +35,8 @@ __lll_lock_wait_private (int *futex)
|
|||||||
futex_wait ((unsigned int *) futex, 2, LLL_PRIVATE); /* Wait if *futex == 2. */
|
futex_wait ((unsigned int *) futex, 2, LLL_PRIVATE); /* Wait if *futex == 2. */
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
libc_hidden_def (__lll_lock_wait_private)
|
||||||
|
|
||||||
|
|
||||||
/* This function doesn't get included in libc. */
|
|
||||||
#if IS_IN (libpthread)
|
|
||||||
void
|
void
|
||||||
__lll_lock_wait (int *futex, int private)
|
__lll_lock_wait (int *futex, int private)
|
||||||
{
|
{
|
||||||
@@ -52,4 +50,4 @@ __lll_lock_wait (int *futex, int private)
|
|||||||
futex_wait ((unsigned int *) futex, 2, private); /* Wait if *futex == 2. */
|
futex_wait ((unsigned int *) futex, 2, private); /* Wait if *futex == 2. */
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
libc_hidden_def (__lll_lock_wait)
|
||||||
|
@@ -75,8 +75,10 @@
|
|||||||
#define lll_cond_trylock(lock) \
|
#define lll_cond_trylock(lock) \
|
||||||
__glibc_unlikely (atomic_compare_and_exchange_bool_acq (&(lock), 2, 0))
|
__glibc_unlikely (atomic_compare_and_exchange_bool_acq (&(lock), 2, 0))
|
||||||
|
|
||||||
extern void __lll_lock_wait_private (int *futex) attribute_hidden;
|
extern void __lll_lock_wait_private (int *futex);
|
||||||
extern void __lll_lock_wait (int *futex, int private) attribute_hidden;
|
libc_hidden_proto (__lll_lock_wait_private)
|
||||||
|
extern void __lll_lock_wait (int *futex, int private);
|
||||||
|
libc_hidden_proto (__lll_lock_wait)
|
||||||
|
|
||||||
/* This is an expression rather than a statement even though its value is
|
/* This is an expression rather than a statement even though its value is
|
||||||
void, so that it can be used in a comma expression or as an expression
|
void, so that it can be used in a comma expression or as an expression
|
||||||
|
@@ -1,8 +0,0 @@
|
|||||||
/* This kludge works around a libpthread static linking problem:
|
|
||||||
https://sourceware.org/bugzilla/show_bug.cgi?id=15648. */
|
|
||||||
|
|
||||||
#ifndef SHARED
|
|
||||||
# define __lll_lock_wait_private weak_function __lll_lock_wait_private
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include <lowlevellock.c>
|
|
Reference in New Issue
Block a user