From 2b5174253155bdace1262ea2ab53d11347ecdefd Mon Sep 17 00:00:00 2001 From: Adhemerval Zanella Date: Tue, 31 Mar 2020 15:43:25 -0300 Subject: 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. --- sysdeps/nptl/dl-tls_init_tp.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'sysdeps') diff --git a/sysdeps/nptl/dl-tls_init_tp.c b/sysdeps/nptl/dl-tls_init_tp.c index 1f77902..378b26a 100644 --- a/sysdeps/nptl/dl-tls_init_tp.c +++ b/sysdeps/nptl/dl-tls_init_tp.c @@ -94,4 +94,6 @@ __tls_init_tp (void) It will be bigger than it actually is, but for unwind.c/pt-longjmp.c purposes this is good enough. */ THREAD_SETMEM (pd, stackblock_size, (size_t) __libc_stack_end); + + THREAD_SETMEM (pd, cancelstate, PTHREAD_CANCEL_ENABLE); } -- cgit v1.1