diff options
Diffstat (limited to 'sysdeps/htl/pthreadP.h')
-rw-r--r-- | sysdeps/htl/pthreadP.h | 24 |
1 files changed, 20 insertions, 4 deletions
diff --git a/sysdeps/htl/pthreadP.h b/sysdeps/htl/pthreadP.h index 78ef4e7..535740f 100644 --- a/sysdeps/htl/pthreadP.h +++ b/sysdeps/htl/pthreadP.h @@ -23,6 +23,7 @@ #include <pthread.h> #include <link.h> +#include <bits/cancelation.h> /* Attribute to indicate thread creation was issued from C11 thrd_create. */ #define ATTR_C11_THREAD ((void*)(uintptr_t)-1) @@ -181,9 +182,13 @@ int __cthread_keycreate (__cthread_key_t *); int __cthread_getspecific (__cthread_key_t, void **); int __cthread_setspecific (__cthread_key_t, void *); int __pthread_key_create (pthread_key_t *key, void (*destr) (void *)); +libc_hidden_proto (__pthread_key_create) void *__pthread_getspecific (pthread_key_t key); +libc_hidden_proto (__pthread_getspecific) int __pthread_setspecific (pthread_key_t key, const void *value); +libc_hidden_proto (__pthread_setspecific) int __pthread_key_delete (pthread_key_t key); +libc_hidden_proto (__pthread_key_delete) int __pthread_once (pthread_once_t *once_control, void (*init_routine) (void)); int __pthread_getattr_np (pthread_t, pthread_attr_t *); @@ -211,14 +216,11 @@ int __pthread_condattr_init (pthread_condattr_t *attr); libc_hidden_proto (__pthread_self) libc_hidden_proto (__pthread_attr_init) libc_hidden_proto (__pthread_condattr_init) +libc_hidden_proto (__pthread_get_cleanup_stack) #if IS_IN (libpthread) hidden_proto (__pthread_create) hidden_proto (__pthread_detach) -hidden_proto (__pthread_key_create) -hidden_proto (__pthread_getspecific) -hidden_proto (__pthread_setspecific) -hidden_proto (__pthread_get_cleanup_stack) #endif #if !defined(__NO_WEAK_PTHREAD_ALIASES) && !IS_IN (libpthread) @@ -233,4 +235,18 @@ weak_extern (__pthread_exit) _Static_assert (sizeof (type) == size, \ "sizeof (" #type ") != " #size) + /* Special cleanup macros which register cleanup both using + __pthread_cleanup_{push,pop} and using cleanup attribute. This is needed + for qsort, so that it supports both throwing exceptions from the caller + sort function callback (only cleanup attribute works there) and + cancellation of the thread running the callback if the callback or some + routines it calls don't have unwind information. + TODO: add support for cleanup routines. */ +#ifndef pthread_cleanup_combined_push +# define pthread_cleanup_combined_push __pthread_cleanup_push +#endif +#ifndef pthread_cleanup_combined_pop +# define pthread_cleanup_combined_pop __pthread_cleanup_pop +#endif + #endif /* pthreadP.h */ |