diff options
Diffstat (limited to 'sysdeps/htl/pthreadP.h')
-rw-r--r-- | sysdeps/htl/pthreadP.h | 57 |
1 files changed, 43 insertions, 14 deletions
diff --git a/sysdeps/htl/pthreadP.h b/sysdeps/htl/pthreadP.h index 78ef4e7..9273a58 100644 --- a/sysdeps/htl/pthreadP.h +++ b/sysdeps/htl/pthreadP.h @@ -23,11 +23,13 @@ #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) -extern void __pthread_init_static_tls (struct link_map *) attribute_hidden; +extern void __pthread_init_static_tls (struct link_map *); +libc_hidden_proto (__pthread_init_static_tls) /* These represent the interface used by glibc itself. */ @@ -137,6 +139,9 @@ extern int __pthread_rwlockattr_setpshared (pthread_rwlockattr_t *__attr, int __pshared); libc_hidden_proto (__pthread_rwlockattr_setpshared) +extern int __pthread_setschedprio (pthread_t __thr, int __prio); +libc_hidden_proto (__pthread_setschedprio) + extern int __pthread_cond_init (pthread_cond_t *cond, const pthread_condattr_t *cond_attr); libc_hidden_proto (__pthread_cond_init) @@ -175,18 +180,35 @@ int __pthread_create (pthread_t *newthread, void __cthread_detach (__cthread_t); int __pthread_detach (pthread_t __threadp); +libc_hidden_proto (__pthread_detach) void __pthread_exit (void *value) __attribute__ ((__noreturn__)); +libc_hidden_proto (__pthread_exit) int __pthread_join (pthread_t, void **); +libc_hidden_proto (__pthread_join) +int __pthread_tryjoin_np (pthread_t __th, void **__thread_return); +libc_hidden_proto (__pthread_tryjoin_np) +int __pthread_timedjoin_np (pthread_t __th, void **__thread_return, + const struct timespec *__abstime); +libc_hidden_proto (__pthread_timedjoin_np) +int __pthread_clockjoin_np (pthread_t __th, void **__thread_return, + clockid_t __clockid, + const struct timespec *__abstime); +libc_hidden_proto (__pthread_clockjoin_np) 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 *); +libc_hidden_proto (__pthread_getattr_np) int __pthread_attr_getstackaddr (const pthread_attr_t *__restrict __attr, void **__restrict __stackaddr); libc_hidden_proto (__pthread_attr_getstackaddr) @@ -203,34 +225,41 @@ libc_hidden_proto (__pthread_attr_setstack) int __pthread_attr_getstack (const pthread_attr_t *, void **, size_t *); libc_hidden_proto (__pthread_attr_getstack) void __pthread_testcancel (void); +libc_hidden_proto (__pthread_testcancel) int __pthread_attr_init (pthread_attr_t *attr); int __pthread_condattr_init (pthread_condattr_t *attr); +int __pthread_setconcurrency (int __new_level); +libc_hidden_proto (__pthread_setconcurrency) +int __pthread_getconcurrency (void); +libc_hidden_proto (__pthread_getconcurrency) #define __pthread_raise_internal(__sig) raise (__sig) 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) -# ifdef weak_extern -weak_extern (__pthread_exit) -# else -# pragma weak __pthread_exit -# endif #endif #define ASSERT_TYPE_SIZE(type, size) \ _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 */ |