From ce0b7961ae400e5aeff28d54dc14955199947b74 Mon Sep 17 00:00:00 2001 From: Florian Weimer Date: Wed, 5 May 2021 17:15:57 +0200 Subject: nptl: Consolidate async cancel enable/disable implementation in libc Previously, the source file nptl/cancellation.c was compiled multiple times, for libc, libpthread, librt. This commit switches to a single implementation, with new __pthread_enable_asynccancel@@GLIBC_PRIVATE, __pthread_disable_asynccancel@@GLIBC_PRIVATE exports. The almost-unused CANCEL_ASYNC and CANCEL_RESET macros are replaced by LIBC_CANCEL_ASYNC and LIBC_CANCEL_ASYNC macros. They call the __pthread_* functions unconditionally now. The macros are still needed because shared code uses them; Hurd has different definitions. Reviewed-by: Adhemerval Zanella --- nptl/Makefile | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'nptl/Makefile') diff --git a/nptl/Makefile b/nptl/Makefile index 884cb69..1337b9e 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 -- cgit v1.1