From 6efd481484e5d8d47b834fd034dc62f4c036d2cf Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Sat, 12 Apr 2003 00:14:16 +0000 Subject: Declare __pthread_unwind. Define __do_cancel to use it. Declare old cleanup handler installation functions. --- nptl/descr.h | 50 ++++++++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 46 insertions(+), 4 deletions(-) (limited to 'nptl/descr.h') 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 #include "../nptl_db/thread_db.h" #include +#ifdef HAVE_FORCED_UNWIND +# include +#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; -- cgit v1.2.3