about summary refs log tree commit diff
path: root/nptl/libc-cancellation.c
diff options
context:
space:
mode:
Diffstat (limited to 'nptl/libc-cancellation.c')
-rw-r--r--nptl/libc-cancellation.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/nptl/libc-cancellation.c b/nptl/libc-cancellation.c
index a68ee71450..c9237e0950 100644
--- a/nptl/libc-cancellation.c
+++ b/nptl/libc-cancellation.c
@@ -42,8 +42,9 @@ __libc_enable_asynccancel (void)
 
       if (__builtin_expect ((oldval & CANCELED_BITMASK) != 0, 0))
 	{
-	  /* If we are already exiting stop right here.  */
-	  if ((oldval & EXITING_BITMASK) != 0)
+	  /* If we are already exiting or if PTHREAD_CANCEL_DISABLED,
+	     stop right here.  */
+	  if ((oldval & (EXITING_BITMASK | CANCELSTATE_BITMASK)) != 0)
 	    break;
 
 	  int curval = THREAD_ATOMIC_CMPXCHG_VAL (self, cancelhandling,