aboutsummaryrefslogtreecommitdiff
path: root/nptl/pthreadP.h
diff options
context:
space:
mode:
authorAdhemerval Zanella <adhemerval.zanella@linaro.org>2020-03-31 15:43:25 -0300
committerAdhemerval Zanella <adhemerval.zanella@linaro.org>2021-06-09 15:16:45 -0300
commit2b5174253155bdace1262ea2ab53d11347ecdefd (patch)
tree9992336533dec0f8cd9579e217b7bc7a18d0733e /nptl/pthreadP.h
parent26cfbb7162ad364d53d69f6d482f2d87b5950524 (diff)
downloadglibc-2b5174253155bdace1262ea2ab53d11347ecdefd.tar
glibc-2b5174253155bdace1262ea2ab53d11347ecdefd.tar.gz
glibc-2b5174253155bdace1262ea2ab53d11347ecdefd.tar.bz2
glibc-2b5174253155bdace1262ea2ab53d11347ecdefd.zip
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.
Diffstat (limited to 'nptl/pthreadP.h')
-rw-r--r--nptl/pthreadP.h12
1 files changed, 0 insertions, 12 deletions
diff --git a/nptl/pthreadP.h b/nptl/pthreadP.h
index 48d48e7008..3e7a4f52ab 100644
--- a/nptl/pthreadP.h
+++ b/nptl/pthreadP.h
@@ -245,18 +245,6 @@ libc_hidden_proto (__pthread_current_priority)
#define INVALID_TD_P(pd) __builtin_expect ((pd)->tid <= 0, 0)
#define INVALID_NOT_TERMINATED_TD_P(pd) __builtin_expect ((pd)->tid < 0, 0)
-/* Cancellation test. */
-#define CANCELLATION_P(self) \
- do { \
- int cancelhandling = THREAD_GETMEM (self, cancelhandling); \
- if (CANCEL_ENABLED_AND_CANCELED (cancelhandling)) \
- { \
- THREAD_SETMEM (self, result, PTHREAD_CANCELED); \
- __do_cancel (); \
- } \
- } while (0)
-
-
extern void __pthread_unwind (__pthread_unwind_buf_t *__buf)
__cleanup_fct_attribute __attribute ((__noreturn__))
#if !defined SHARED && !IS_IN (libpthread)