aboutsummaryrefslogtreecommitdiff
path: root/nptl/descr.h
diff options
context:
space:
mode:
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;