nptl: Move cancel state out of cancelhandling
authorAdhemerval Zanella <adhemerval.zanella@linaro.org>
Tue, 31 Mar 2020 18:43:25 +0000 (15:43 -0300)
committerAdhemerval Zanella <adhemerval.zanella@linaro.org>
Wed, 9 Jun 2021 18:16:45 +0000 (15:16 -0300)
commit2b5174253155bdace1262ea2ab53d11347ecdefd
tree9992336533dec0f8cd9579e217b7bc7a18d0733e
parent26cfbb7162ad364d53d69f6d482f2d87b5950524
nptl: Move cancel state out of cancelhandling

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

The code is also simplified: CANCELLATION_P is replaced with a
internal pthread_testcancel call and the CANCELSTATE_BIT{MASK} is
removed.

With this behavior pthread_setcancelstate does not require to act on
cancellation if cancel type is asynchronous (is already handled either
by pthread_setcanceltype or by the signal handler).

Checked on x86_64-linux-gnu and aarch64-linux-gnu.
14 files changed:
manual/pattern.texi
manual/process.texi
nptl/allocatestack.c
nptl/cancellation.c
nptl/cleanup_defer.c
nptl/descr.h
nptl/libc-cleanup.c
nptl/pthreadP.h
nptl/pthread_cancel.c
nptl/pthread_join_common.c
nptl/pthread_setcancelstate.c
nptl/pthread_setcanceltype.c
nptl/pthread_testcancel.c
sysdeps/nptl/dl-tls_init_tp.c