about summary refs log tree commit diff
path: root/nptl/descr.h
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2003-04-12 00:14:16 +0000
committerUlrich Drepper <drepper@redhat.com>2003-04-12 00:14:16 +0000
commit6efd481484e5d8d47b834fd034dc62f4c036d2cf (patch)
treec4bd9e169d534ceaf83f4b3f6b7f034e0e1cb379 /nptl/descr.h
parent32b0da568de098fc2d62da7cf6a06ddbaba156d7 (diff)
downloadglibc-6efd481484e5d8d47b834fd034dc62f4c036d2cf.tar.gz
glibc-6efd481484e5d8d47b834fd034dc62f4c036d2cf.tar.xz
glibc-6efd481484e5d8d47b834fd034dc62f4c036d2cf.zip
Declare __pthread_unwind. Define __do_cancel to use it. Declare old cleanup handler installation functions.
Diffstat (limited to 'nptl/descr.h')
-rw-r--r--nptl/descr.h50
1 files changed, 46 insertions, 4 deletions
diff --git a/nptl/descr.h b/nptl/descr.h
index 3625b15088..28b7afa1a1 100644
--- a/nptl/descr.h
+++ b/nptl/descr.h
@@ -32,6 +32,9 @@
 #include <dl-sysdep.h>
 #include "../nptl_db/thread_db.h"
 #include <tls.h>
+#ifdef HAVE_FORCED_UNWIND
+# include <unwind.h>
+#endif
 
 
 #ifndef TCB_ALIGNMENT
@@ -54,6 +57,45 @@
    / PTHREAD_KEY_2NDLEVEL_SIZE)
 
 
+
+
+/* Internal version of the buffer to store cancellation handler
+   information.  */
+struct pthread_unwind_buf
+{
+  union
+  {
+    /* This is the placeholder of the public version.  */
+    void *pad[16];
+
+    struct
+    {
+#ifdef HAVE_FORCED_UNWIND
+      /* First the machine-specific unwind info.  */
+      struct _Unwind_Exception exc;
+#endif
+
+      /* Pointer to the previous cleanup buffer.  */
+      __pthread_unwind_buf_t *prev;
+
+      /* Backward compatibility: state of the old-style cleanup
+	 handler at the time of the previous new-style cleanup handler
+	 installment.  */
+      struct _pthread_cleanup_buffer *cleanup;
+
+      /* Cancellation type before the push call.  */
+      int canceltype;
+    } data;
+  } priv;
+
+  struct
+  {
+    __jmp_buf jmp_buf;
+    int mask_was_saved;
+  } cancel_jmp_buf[1];
+};
+
+
 /* Thread descriptor data structure.  */
 struct pthread
 {
@@ -86,6 +128,10 @@ struct pthread
   /* List of cleanup buffers.  */
   struct _pthread_cleanup_buffer *cleanup;
 
+  /* Unwind information.  */
+  __pthread_unwind_buf_t *cleanup_jmp_buf;
+#define HAVE_CLEANUP_JMP_BUF
+
   /* Flags determining processing of cancellation.  */
   int cancelhandling;
   /* Bit set if cancellation is disabled.  */
@@ -160,10 +206,6 @@ struct pthread
   /* Check whether a thread is detached.  */
 #define IS_DETACHED(pd) ((pd)->joinid == (pd))
 
-  /* Setjmp buffer to be used if try/finally is not available.  */
-  sigjmp_buf cancelbuf;
-#define HAVE_CANCELBUF	1
-
   /* Flags.  Including those copied from the thread attribute.  */
   int flags;