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. --- nptl/allocatestack.c | 1 + 1 file changed, 1 insertion(+) (limited to 'nptl/allocatestack.c') diff --git a/nptl/allocatestack.c b/nptl/allocatestack.c index 2114bd2..54e95ba 100644 --- a/nptl/allocatestack.c +++ b/nptl/allocatestack.c @@ -160,6 +160,7 @@ get_cached_stack (size_t *sizep, void **memp) /* Cancellation handling is back to the default. */ result->cancelhandling = 0; + result->cancelstate = PTHREAD_CANCEL_ENABLE; result->cleanup = NULL; result->setup_failed = 0; -- cgit v1.1