about summary refs log tree commit diff
path: root/nptl/descr.h
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2003-02-14 18:33:54 +0000
committerUlrich Drepper <drepper@redhat.com>2003-02-14 18:33:54 +0000
commite320ef46a7283517aeba1decc20ffb38ed131281 (patch)
treebe9af48c1823694fde8d21ef1de61918b8205126 /nptl/descr.h
parent700bf7af9f98174f33ac177332bcbcd644055474 (diff)
downloadglibc-e320ef46a7283517aeba1decc20ffb38ed131281.tar.gz
glibc-e320ef46a7283517aeba1decc20ffb38ed131281.tar.xz
glibc-e320ef46a7283517aeba1decc20ffb38ed131281.zip
Update.
	* descr.h: Define CANCELING_BIT and CANCELING_BITMASK.  Introduce
	after CANCELTYPE_BIT, move the other bits up.  Update CANCEL_RESTMASK.
	* init.c (sigcancel_handler): Also set CANCELING_BITMASK bit in newval.
	* pthread_cancel.c (pthread_cancel): Likewise.  Also set CANCELING_BIT
	if asynchronous canceling is enabled.
	* pthread_join.c (pthread_join): When recognizing circular joins,
	take into account the other thread might be already canceled.
	* Makefile (tests): Add tst-join5.
	* tst-join5.c: New file.
Diffstat (limited to 'nptl/descr.h')
-rw-r--r--nptl/descr.h19
1 files changed, 11 insertions, 8 deletions
diff --git a/nptl/descr.h b/nptl/descr.h
index 3fe04ec2aa..e96f538c68 100644
--- a/nptl/descr.h
+++ b/nptl/descr.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2002 Free Software Foundation, Inc.
+/* Copyright (C) 2002, 2003 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
 
@@ -127,17 +127,20 @@ struct pthread
   /* Bit set if asynchronous cancellation mode is selected.  */
 #define CANCELTYPE_BIT		1
 #define CANCELTYPE_BITMASK	0x02
+  /* Bit set if canceling has been initiated.  */
+#define CANCELING_BIT		2
+#define CANCELING_BITMASK	0x04
   /* Bit set if canceled.  */
-#define CANCELED_BIT		2
-#define CANCELED_BITMASK	0x04
+#define CANCELED_BIT		3
+#define CANCELED_BITMASK	0x08
   /* Bit set if thread is exiting.  */
-#define EXITING_BIT		3
-#define EXITING_BITMASK		0x08
+#define EXITING_BIT		4
+#define EXITING_BITMASK		0x10
   /* Bit set if thread terminated and TCB is freed.  */
-#define TERMINATED_BIT		4
-#define TERMINATED_BITMASK	0x10
+#define TERMINATED_BIT		5
+#define TERMINATED_BITMASK	0x20
   /* Mask for the rest.  Helps the compiler to optimize.  */
-#define CANCEL_RESTMASK		0xffffffe0
+#define CANCEL_RESTMASK		0xffffffc0
 
 #define CANCEL_ENABLED_AND_CANCELED(value) \
   (((value) & (CANCELSTATE_BITMASK | CANCELED_BITMASK | EXITING_BITMASK	      \