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/cancellation.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'nptl/cancellation.c') 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) -- cgit 1.4.1