diff options
Diffstat (limited to 'nptl')
-rw-r--r-- | nptl/Makefile | 4 | ||||
-rw-r--r-- | nptl/Versions | 2 | ||||
-rw-r--r-- | nptl/cancellation.c | 4 | ||||
-rw-r--r-- | nptl/libc-cancellation.c | 24 | ||||
-rw-r--r-- | nptl/pthreadP.h | 2 | ||||
-rw-r--r-- | nptl/pthread_create.c | 4 |
6 files changed, 7 insertions, 33 deletions
diff --git a/nptl/Makefile b/nptl/Makefile index 884cb69bb4..1337b9e648 100644 --- a/nptl/Makefile +++ b/nptl/Makefile @@ -30,6 +30,7 @@ extra-libs-others := $(extra-libs) routines = \ alloca_cutoff \ + cancellation \ cleanup_compat \ cleanup_defer_compat \ cleanup_routine \ @@ -39,7 +40,6 @@ routines = \ elision-trylock \ elision-unlock \ futex-internal \ - libc-cancellation \ libc-cleanup \ libc_multiple_threads \ libc_pthread_init \ @@ -157,7 +157,6 @@ shared-only-routines = forward static-only-routines = pthread_atfork libpthread-routines = \ - cancellation \ cleanup \ cleanup_defer \ events \ @@ -239,7 +238,6 @@ CFLAGS-pthread_setcanceltype.c += -fexceptions -fasynchronous-unwind-tables # These are internal functions which similar functionality as setcancelstate # and setcanceltype. CFLAGS-cancellation.c += -fasynchronous-unwind-tables -CFLAGS-libc-cancellation.c += -fasynchronous-unwind-tables # Calling pthread_exit() must cause the registered cancel handlers to # be executed. Therefore exceptions have to be thrown through this diff --git a/nptl/Versions b/nptl/Versions index ce09c73727..e845cbf804 100644 --- a/nptl/Versions +++ b/nptl/Versions @@ -281,6 +281,8 @@ libc { __pthread_cleanup_push; __pthread_cleanup_upto; __pthread_current_priority; + __pthread_disable_asynccancel; + __pthread_enable_asynccancel; __pthread_force_elision; __pthread_getattr_default_np; __pthread_keys; diff --git a/nptl/cancellation.c b/nptl/cancellation.c index 2ee633eabc..c20845adc0 100644 --- a/nptl/cancellation.c +++ b/nptl/cancellation.c @@ -28,7 +28,6 @@ AS-safe, with the exception of the actual cancellation, because they are called by wrappers around AS-safe functions like write().*/ int -attribute_hidden __pthread_enable_asynccancel (void) { struct pthread *self = THREAD_SELF; @@ -60,11 +59,11 @@ __pthread_enable_asynccancel (void) return oldval; } +libc_hidden_def (__pthread_enable_asynccancel) /* See the comment for __pthread_enable_asynccancel regarding the AS-safety of this function. */ void -attribute_hidden __pthread_disable_asynccancel (int oldtype) { /* If asynchronous cancellation was enabled before we do not have @@ -102,3 +101,4 @@ __pthread_disable_asynccancel (int oldtype) newval = THREAD_GETMEM (self, cancelhandling); } } +libc_hidden_def (__pthread_disable_asynccancel) diff --git a/nptl/libc-cancellation.c b/nptl/libc-cancellation.c deleted file mode 100644 index 29f5a5864b..0000000000 --- a/nptl/libc-cancellation.c +++ /dev/null @@ -1,24 +0,0 @@ -/* Copyright (C) 2002-2021 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Ulrich Drepper <drepper@redhat.com>, 2002. - - 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 "pthreadP.h" - - -#define __pthread_enable_asynccancel __libc_enable_asynccancel -#define __pthread_disable_asynccancel __libc_disable_asynccancel -#include <nptl/cancellation.c> diff --git a/nptl/pthreadP.h b/nptl/pthreadP.h index d480639740..6b52ca158e 100644 --- a/nptl/pthreadP.h +++ b/nptl/pthreadP.h @@ -567,8 +567,6 @@ libc_hidden_proto (__pthread_exit) extern int __pthread_join (pthread_t threadid, void **thread_return); extern int __pthread_setcanceltype (int type, int *oldtype); libc_hidden_proto (__pthread_setcanceltype) -extern int __pthread_enable_asynccancel (void) attribute_hidden; -extern void __pthread_disable_asynccancel (int oldtype) attribute_hidden; extern void __pthread_testcancel (void); libc_hidden_proto (__pthread_testcancel) extern int __pthread_clockjoin_ex (pthread_t, void **, clockid_t, diff --git a/nptl/pthread_create.c b/nptl/pthread_create.c index d89a83b38a..775287d0e4 100644 --- a/nptl/pthread_create.c +++ b/nptl/pthread_create.c @@ -353,7 +353,7 @@ START_THREAD_DEFN have ownership (see CONCURRENCY NOTES above). */ if (__glibc_unlikely (pd->stopped_start)) { - int oldtype = CANCEL_ASYNC (); + int oldtype = LIBC_CANCEL_ASYNC (); /* Get the lock the parent locked to force synchronization. */ lll_lock (pd->lock, LLL_PRIVATE); @@ -363,7 +363,7 @@ START_THREAD_DEFN /* And give it up right away. */ lll_unlock (pd->lock, LLL_PRIVATE); - CANCEL_RESET (oldtype); + LIBC_CANCEL_RESET (oldtype); } LIBC_PROBE (pthread_start, 3, (pthread_t) pd, pd->start_routine, pd->arg); |