diff options
author | Florian Weimer <fweimer@redhat.com> | 2021-04-21 19:49:50 +0200 |
---|---|---|
committer | Florian Weimer <fweimer@redhat.com> | 2021-04-21 19:49:50 +0200 |
commit | 1f2e5bfe48ae7a0a74896d7f3019d976c1647e56 (patch) | |
tree | 103c889d6d7a47e9e3be01325aaaa5d532ed75a6 /nptl/pthreadP.h | |
parent | f79f2065817e080f65f3c3a2fee966f5a97f1746 (diff) | |
download | glibc-1f2e5bfe48ae7a0a74896d7f3019d976c1647e56.tar.gz glibc-1f2e5bfe48ae7a0a74896d7f3019d976c1647e56.tar.xz glibc-1f2e5bfe48ae7a0a74896d7f3019d976c1647e56.zip |
nptl: Move legacy cancelation handling into libc as compat symbols
This affects _pthread_cleanup_pop, _pthread_cleanup_pop_restore, _pthread_cleanup_push, _pthread_cleanup_push_defer. The symbols have been moved using scripts/move-symbol-to-libc.py. No new symbol versions are added because the symbols are turned into compatibility symbols at the same time. __pthread_cleanup_pop and __pthread_cleanup_push are added as GLIBC_PRIVATE symbols because they are also used internally, for glibc's own cancellation handling. Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Diffstat (limited to 'nptl/pthreadP.h')
-rw-r--r-- | nptl/pthreadP.h | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/nptl/pthreadP.h b/nptl/pthreadP.h index 2653e0f1b3..9cc968222f 100644 --- a/nptl/pthreadP.h +++ b/nptl/pthreadP.h @@ -591,11 +591,10 @@ libc_hidden_proto (__pthread_attr_setsigmask_internal) extern __typeof (pthread_attr_getsigmask_np) __pthread_attr_getsigmask_np; libc_hidden_proto (__pthread_attr_getsigmask_np) -#if IS_IN (libpthread) /* Special versions which use non-exported functions. */ extern void __pthread_cleanup_push (struct _pthread_cleanup_buffer *buffer, - void (*routine) (void *), void *arg) - attribute_hidden; + void (*routine) (void *), void *arg); +libc_hidden_proto (__pthread_cleanup_push) /* Replace cleanup macros defined in <pthread.h> with internal versions that don't depend on unwind info and better support @@ -606,12 +605,13 @@ extern void __pthread_cleanup_push (struct _pthread_cleanup_buffer *buffer, __pthread_cleanup_push (&_buffer, (routine), (arg)); extern void __pthread_cleanup_pop (struct _pthread_cleanup_buffer *buffer, - int execute) attribute_hidden; + int execute); +libc_hidden_proto (__pthread_cleanup_pop) # undef pthread_cleanup_pop # define pthread_cleanup_pop(execute) \ __pthread_cleanup_pop (&_buffer, (execute)); } -# if defined __EXCEPTIONS && !defined __cplusplus +#if defined __EXCEPTIONS && !defined __cplusplus /* Structure to hold the cleanup handler information. */ struct __pthread_cleanup_combined_frame { @@ -652,7 +652,7 @@ __pthread_cleanup_combined_routine_voidptr (void *__arg) } } -# define pthread_cleanup_combined_push(routine, arg) \ +# define pthread_cleanup_combined_push(routine, arg) \ do { \ void (*__cancel_routine) (void *) = (routine); \ struct __pthread_cleanup_combined_frame __clframe \ @@ -663,15 +663,14 @@ __pthread_cleanup_combined_routine_voidptr (void *__arg) __pthread_cleanup_combined_routine_voidptr, \ &__clframe); -# define pthread_cleanup_combined_pop(execute) \ +# define pthread_cleanup_combined_pop(execute) \ __pthread_cleanup_pop (&__clframe.__buffer, 0); \ __clframe.__do_it = 0; \ if (execute) \ __cancel_routine (__clframe.__cancel_arg); \ } while (0) -# endif -#endif +#endif /* __EXCEPTIONS && !defined __cplusplus */ extern void __pthread_cleanup_push_defer (struct _pthread_cleanup_buffer *buffer, void (*routine) (void *), void *arg); |