aboutsummaryrefslogtreecommitdiff
path: root/nptl/cancellation.c
diff options
context:
space:
mode:
authorFlorian Weimer <fweimer@redhat.com>2021-05-05 17:15:57 +0200
committerFlorian Weimer <fweimer@redhat.com>2021-05-05 17:19:32 +0200
commitce0b7961ae400e5aeff28d54dc14955199947b74 (patch)
tree3e7acb0eb6915c2c3af747dd9d982d4dc3418b78 /nptl/cancellation.c
parent0197c1bc604e1d6357cfa07a75ab73bababa7f0f (diff)
downloadglibc-ce0b7961ae400e5aeff28d54dc14955199947b74.zip
glibc-ce0b7961ae400e5aeff28d54dc14955199947b74.tar.gz
glibc-ce0b7961ae400e5aeff28d54dc14955199947b74.tar.bz2
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 <adhemerval.zanella@linaro.org>
Diffstat (limited to 'nptl/cancellation.c')
-rw-r--r--nptl/cancellation.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/nptl/cancellation.c b/nptl/cancellation.c
index 2ee633e..c20845a 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)