diff options
author | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2020-06-14 12:56:54 +0000 |
---|---|---|
committer | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2020-06-14 15:53:04 +0000 |
commit | a50efac19a1eb0a9dc6f5917ae299c0fbbf3c46b (patch) | |
tree | 975cff922cf658c87dfc70e3b4fb490fdca8519b /htl/pt-internal.h | |
parent | e2b9d562d1e024fda6d10f0f272521bf20fa664f (diff) | |
download | glibc-a50efac19a1eb0a9dc6f5917ae299c0fbbf3c46b.tar.gz glibc-a50efac19a1eb0a9dc6f5917ae299c0fbbf3c46b.tar.xz glibc-a50efac19a1eb0a9dc6f5917ae299c0fbbf3c46b.zip |
htl: Move cleanup stack to variable shared between libc and pthread
If libpthread gets loaded dynamically, the stack needs to already contain the cleanup handlers of the main thread. * htl/libc_pthread_init.c (__pthread_cleanup_stack): New per-thread variable. * htl/Versions (libc): Add __pthread_cleanup_stack as private symbol. * htl/pt-internal.h (struct __pthread): Remove cancelation_handlers field. (__pthread_cleanup_stack): Add variable declaration. * htl/pt-alloc.c (initialize_pthread): Remove initialization of cancelation_handlers field. * htl/pt-cleanup.c (__pthread_get_cleanup_stack): Return the address of __pthread_cleanup_stack instead of that of the cancelation_handlers field. * htl/forward.c: Include <pt-internal.h>. (dummy_list): Remove variable. (__pthread_get_cleanup_stack): Return the address of __pthread_cleanup_stack instead of that of dummy_list.
Diffstat (limited to 'htl/pt-internal.h')
-rw-r--r-- | htl/pt-internal.h | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/htl/pt-internal.h b/htl/pt-internal.h index 918c207c3e..e0baa6bcda 100644 --- a/htl/pt-internal.h +++ b/htl/pt-internal.h @@ -81,7 +81,6 @@ struct __pthread int cancel_state; int cancel_type; int cancel_pending; - struct __pthread_cancelation_handler *cancelation_handlers; /* Thread stack. */ void *stackaddr; @@ -197,6 +196,9 @@ extern pthread_rwlock_t __pthread_threads_lock; #ifndef _pthread_self extern struct __pthread *_pthread_self (void); #endif + +/* Stores the stack of cleanup handlers for the thread. */ +extern __thread struct __pthread_cancelation_handler *__pthread_cleanup_stack; /* Initialize the pthreads library. */ |