diff options
| author | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2025-11-16 14:09:11 +0000 |
|---|---|---|
| committer | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2025-11-17 00:38:37 +0000 |
| commit | 5b6ee0e0ba7321ca37db12a942493e4ea8eead92 (patch) | |
| tree | 831dc5b6ba00e85e9ecf5a3df8cf4a7ab36c7fd5 /sysdeps/mach | |
| parent | f63dd924312919667f8c71f7701523dfdc542067 (diff) | |
htl: move pthread_create to into libc
This is notably needed for the main thread structure to be always
initialized so that some pthread functions can work from the main thread
without other threads, e.g. pthread_cancel.
Diffstat (limited to 'sysdeps/mach')
| -rw-r--r-- | sysdeps/mach/hurd/htl/pt-sysdep.c | 14 | ||||
| -rw-r--r-- | sysdeps/mach/hurd/i386/libc.abilist | 2 | ||||
| -rw-r--r-- | sysdeps/mach/hurd/i386/libpthread.abilist | 1 | ||||
| -rw-r--r-- | sysdeps/mach/hurd/x86_64/libc.abilist | 2 | ||||
| -rw-r--r-- | sysdeps/mach/hurd/x86_64/libpthread.abilist | 1 |
5 files changed, 8 insertions, 12 deletions
diff --git a/sysdeps/mach/hurd/htl/pt-sysdep.c b/sysdeps/mach/hurd/htl/pt-sysdep.c index 43745095bf..4d6a710ca8 100644 --- a/sysdeps/mach/hurd/htl/pt-sysdep.c +++ b/sysdeps/mach/hurd/htl/pt-sysdep.c @@ -26,6 +26,9 @@ #include <pt-internal.h> #include <pthreadP.h> #include <stackinfo.h> +#include <ldsodefs.h> +#include <register-atfork.h> +#include <dso_handle.h> static void reset_pthread_total (void) @@ -118,7 +121,7 @@ _init_routine (void *stack) when we return from here) shouldn't be seen as a user thread. */ __pthread_total--; - __pthread_atfork (NULL, NULL, reset_pthread_total); + __register_atfork (NULL, NULL, reset_pthread_total, __dso_handle); GL(dl_init_static_tls) = &__pthread_init_static_tls; @@ -131,12 +134,3 @@ __pthread_initialize_minimal (void) { _init_routine (__libc_stack_end); } - -#ifdef SHARED -__attribute__ ((constructor)) -static void -dynamic_init_routine (void) -{ - _init_routine (__libc_stack_end); -} -#endif diff --git a/sysdeps/mach/hurd/i386/libc.abilist b/sysdeps/mach/hurd/i386/libc.abilist index bbd00ed11a..f7c323c834 100644 --- a/sysdeps/mach/hurd/i386/libc.abilist +++ b/sysdeps/mach/hurd/i386/libc.abilist @@ -76,6 +76,7 @@ GLIBC_2.12 pthread_condattr_getpshared F GLIBC_2.12 pthread_condattr_init F GLIBC_2.12 pthread_condattr_setclock F GLIBC_2.12 pthread_condattr_setpshared F +GLIBC_2.12 pthread_create F GLIBC_2.12 pthread_detach F GLIBC_2.12 pthread_equal F GLIBC_2.12 pthread_exit F @@ -2670,6 +2671,7 @@ GLIBC_2.43 memalignment F GLIBC_2.43 memset_explicit F GLIBC_2.43 pthread_cancel F GLIBC_2.43 pthread_clockjoin_np F +GLIBC_2.43 pthread_create F GLIBC_2.43 pthread_detach F GLIBC_2.43 pthread_getattr_np F GLIBC_2.43 pthread_getconcurrency F diff --git a/sysdeps/mach/hurd/i386/libpthread.abilist b/sysdeps/mach/hurd/i386/libpthread.abilist index c55b78b01c..e1844a8f5e 100644 --- a/sysdeps/mach/hurd/i386/libpthread.abilist +++ b/sysdeps/mach/hurd/i386/libpthread.abilist @@ -5,7 +5,6 @@ GLIBC_2.12 __pthread_spin_trylock F GLIBC_2.12 __pthread_spin_unlock F GLIBC_2.12 _pthread_spin_lock F GLIBC_2.12 pthread_atfork F -GLIBC_2.12 pthread_create F GLIBC_2.12 pthread_spin_destroy F GLIBC_2.12 pthread_spin_init F GLIBC_2.12 pthread_spin_lock F diff --git a/sysdeps/mach/hurd/x86_64/libc.abilist b/sysdeps/mach/hurd/x86_64/libc.abilist index 5fb477342e..b482d2d040 100644 --- a/sysdeps/mach/hurd/x86_64/libc.abilist +++ b/sysdeps/mach/hurd/x86_64/libc.abilist @@ -1556,6 +1556,7 @@ GLIBC_2.38 pthread_condattr_getpshared F GLIBC_2.38 pthread_condattr_init F GLIBC_2.38 pthread_condattr_setclock F GLIBC_2.38 pthread_condattr_setpshared F +GLIBC_2.38 pthread_create F GLIBC_2.38 pthread_detach F GLIBC_2.38 pthread_equal F GLIBC_2.38 pthread_exit F @@ -2348,6 +2349,7 @@ GLIBC_2.43 memalignment F GLIBC_2.43 memset_explicit F GLIBC_2.43 pthread_cancel F GLIBC_2.43 pthread_clockjoin_np F +GLIBC_2.43 pthread_create F GLIBC_2.43 pthread_detach F GLIBC_2.43 pthread_getattr_np F GLIBC_2.43 pthread_getconcurrency F diff --git a/sysdeps/mach/hurd/x86_64/libpthread.abilist b/sysdeps/mach/hurd/x86_64/libpthread.abilist index 77d9a6601d..d4ae93df53 100644 --- a/sysdeps/mach/hurd/x86_64/libpthread.abilist +++ b/sysdeps/mach/hurd/x86_64/libpthread.abilist @@ -17,7 +17,6 @@ GLIBC_2.38 mtx_lock F GLIBC_2.38 mtx_timedlock F GLIBC_2.38 mtx_trylock F GLIBC_2.38 mtx_unlock F -GLIBC_2.38 pthread_create F GLIBC_2.38 pthread_hurd_cond_timedwait_np F GLIBC_2.38 pthread_hurd_cond_wait_np F GLIBC_2.38 pthread_spin_destroy F |
