diff options
Diffstat (limited to 'sysdeps')
-rw-r--r-- | sysdeps/nptl/libc-lockP.h | 5 | ||||
-rw-r--r-- | sysdeps/nptl/pthread-functions.h | 2 | ||||
-rw-r--r-- | sysdeps/unix/sysv/linux/fatal-prepare.h | 19 |
3 files changed, 7 insertions, 19 deletions
diff --git a/sysdeps/nptl/libc-lockP.h b/sysdeps/nptl/libc-lockP.h index a64daca008..29494fd67b 100644 --- a/sysdeps/nptl/libc-lockP.h +++ b/sysdeps/nptl/libc-lockP.h @@ -376,6 +376,7 @@ extern int __pthread_atfork (void (*__prepare) (void), void (*__parent) (void), void (*__child) (void)); +extern int __pthread_setcancelstate (int state, int *oldstate); /* Make the pthread functions weak so that we can elide them from @@ -403,9 +404,9 @@ weak_extern (__pthread_getspecific) weak_extern (__pthread_once) weak_extern (__pthread_initialize) weak_extern (__pthread_atfork) +weak_extern (__pthread_setcancelstate) weak_extern (_pthread_cleanup_push_defer) weak_extern (_pthread_cleanup_pop_restore) -weak_extern (pthread_setcancelstate) # else # pragma weak __pthread_mutex_init # pragma weak __pthread_mutex_destroy @@ -427,9 +428,9 @@ weak_extern (pthread_setcancelstate) # pragma weak __pthread_once # pragma weak __pthread_initialize # pragma weak __pthread_atfork +# pragma weak __pthread_setcancelstate # pragma weak _pthread_cleanup_push_defer # pragma weak _pthread_cleanup_pop_restore -# pragma weak pthread_setcancelstate # endif #endif diff --git a/sysdeps/nptl/pthread-functions.h b/sysdeps/nptl/pthread-functions.h index 0784c59cab..f37e9fd4b8 100644 --- a/sysdeps/nptl/pthread-functions.h +++ b/sysdeps/nptl/pthread-functions.h @@ -75,7 +75,7 @@ struct pthread_functions int (*ptr_pthread_mutex_lock) (pthread_mutex_t *); int (*ptr_pthread_mutex_unlock) (pthread_mutex_t *); pthread_t (*ptr_pthread_self) (void); - int (*ptr_pthread_setcancelstate) (int, int *); + int (*ptr___pthread_setcancelstate) (int, int *); int (*ptr_pthread_setcanceltype) (int, int *); void (*ptr___pthread_cleanup_upto) (__jmp_buf, char *); int (*ptr___pthread_once) (pthread_once_t *, void (*) (void)); diff --git a/sysdeps/unix/sysv/linux/fatal-prepare.h b/sysdeps/unix/sysv/linux/fatal-prepare.h index 45d88ce911..2a89567299 100644 --- a/sysdeps/unix/sysv/linux/fatal-prepare.h +++ b/sysdeps/unix/sysv/linux/fatal-prepare.h @@ -19,19 +19,6 @@ /* We have to completely disable cancellation. assert() must not be a cancellation point but the implementation uses write() etc. */ -#ifdef SHARED -# include <pthread-functions.h> -# define FATAL_PREPARE \ - { \ - if (__libc_pthread_functions_init) \ - PTHFCT_CALL (ptr_pthread_setcancelstate, (PTHREAD_CANCEL_DISABLE, \ - NULL)); \ - } -#else -# pragma weak pthread_setcancelstate -# define FATAL_PREPARE \ - { \ - if (pthread_setcancelstate != NULL) \ - pthread_setcancelstate (PTHREAD_CANCEL_DISABLE, NULL); \ - } -#endif +#define FATAL_PREPARE \ + __libc_ptf_call (__pthread_setcancelstate, \ + (PTHREAD_CANCEL_DISABLE, NULL), 0) |