nptl: Move cancel type out of cancelhandling

System Internals / glibc - Adhemerval Zanella [linaro.org] - 9 June 2021 18:16 UTC

Now that the thread cancellation type is not accessed concurrently anymore, it is possible to move it out the cancelhandling.

By removing the cancel state out of the internal thread cancel handling state there is no need to check if cancelled bit was set in CAS operation.

It allows simplifing the cancellation wrappers and the CANCEL_CANCELED_AND_ASYNCHRONOUS is removed.

Checked on x86_64-linux-gnu and aarch64-linux-gnu.

8c1c0aae20 nptl: Move cancel type out of cancelhandling
nptl/allocatestack.c | 1 +
nptl/cancellation.c | 51 ++++++++++---------------------------------
nptl/cleanup_defer.c | 46 +++++---------------------------------
nptl/descr.h | 14 ++++--------
nptl/libc-cleanup.c | 44 ++++---------------------------------
nptl/pthread_cancel.c | 6 ++---
nptl/pthread_setcanceltype.c | 42 +++++------------------------------
sysdeps/nptl/dl-tls_init_tp.c | 1 +
8 files changed, 35 insertions(+), 170 deletions(-)

Upstream: sourceware.org


  • Share