LCLHDRS :=
libpthread-routines := \
- pt-create \
pt-spin-inlines \
pt-hurd-cond-wait \
pt-hurd-cond-timedwait \
- pt-sysdep \
pt-spin \
pt-getname-np \
pt-setname-np \
pt-condattr-init \
pt-condattr-setclock \
pt-condattr-setpshared \
+ pt-create \
pt-dealloc \
pt-destroy-specific \
pt-detach \
pt-sigstate-init \
pt-stack-alloc \
pt-startup \
+ pt-sysdep \
pt-testcancel \
pt-thread-alloc \
pt-thread-start \
pthread_condattr_getpshared;
pthread_condattr_setclock;
pthread_condattr_setpshared;
+ pthread_create;
pthread_detach;
pthread_getattr_np;
pthread_getconcurrency;
GLIBC_2.43 {
pthread_cancel;
pthread_clockjoin_np;
+ pthread_create;
pthread_detach;
pthread_getattr_np;
pthread_getconcurrency;
__pthread_alloc;
__pthread_block;
__pthread_block_intr;
+ __pthread_create;
__pthread_init_thread;
__pthread_init_static_tls;
__pthread_default_attr;
__pthread_destroy_specific;
__pthread_exit;
__pthread_getspecific;
+ __pthread_initialize_minimal;
__pthread_join;
__pthread_key_delete;
__pthread_max_threads;
GLIBC_2.12 {
pthread_atfork;
- pthread_create;
-
pthread_spin_destroy; pthread_spin_init; pthread_spin_lock;
pthread_spin_trylock; pthread_spin_unlock;
__pthread_spin_destroy; __pthread_spin_init;
pthread_getname_np;
pthread_setname_np;
}
-
- GLIBC_PRIVATE {
- __pthread_initialize_minimal;
-
- __pthread_create;
- }
}
#include <atomic.h>
#include <hurd/resource.h>
#include <sys/single_threaded.h>
+#include <shlib-compat.h>
+#include <ldsodefs.h>
#include <pt-internal.h>
#include <pthreadP.h>
-#if IS_IN (libpthread)
-# include <ctype.h>
-#endif
+#include <ctype.h>
+
#ifdef HAVE_USELOCALE
# include <locale.h>
#endif
___pthread_self = self;
__resp = &self->res_state;
-#if IS_IN (libpthread)
/* Initialize pointers to locale data. */
__ctype_init ();
-#endif
+
#ifdef HAVE_USELOCALE
/* A fresh thread needs to be bound to the global locale. */
uselocale (LC_GLOBAL_LOCALE);
int
__pthread_create (pthread_t * thread, const pthread_attr_t * attr,
void *(*start_routine) (void *), void *arg)
+{
+ /* Avoid a data race in the multi-threaded case. */
+ if (__libc_single_threaded)
+ __libc_single_threaded = 0;
+
+ return __libc_pthread_create (thread, attr, start_routine, arg);
+}
+versioned_symbol (libc, __pthread_create, pthread_create, GLIBC_2_43);
+#if OTHER_SHLIB_COMPAT (libpthread, GLIBC_2_12, GLIBC_2_43)
+compat_symbol (libpthread, __pthread_create, pthread_create, GLIBC_2_12);
+#endif
+hidden_def (__pthread_create)
+
+/* Version of pthread_create which does not make __libc_single_threaded zero.
+ This is notably useful for the signal thread. */
+int
+__libc_pthread_create (pthread_t * thread, const pthread_attr_t * attr,
+ void *(*start_routine) (void *), void *arg)
{
int err;
struct __pthread *pthread;
return err;
}
-weak_alias (__pthread_create, pthread_create)
-hidden_def (__pthread_create)
/* Internal version of pthread_create. See comment in
pt-internal.h. */
sigset_t sigset;
size_t stacksize;
- /* Avoid a data race in the multi-threaded case. */
- if (__libc_single_threaded)
- __libc_single_threaded = 0;
-
/* Allocate a new thread structure. */
err = __pthread_alloc (&pthread);
if (err)
/* Start the signal thread listening on the message port. */
-#pragma weak __pthread_create
- if (!__pthread_create)
+#pragma weak __libc_pthread_create
+ if (!__libc_pthread_create)
{
err = __thread_create (__mach_task_self (), &_hurd_msgport_thread);
assert_perror (err);
#pragma weak __pthread_detach
#pragma weak __pthread_getattr_np
#pragma weak __pthread_attr_getstack
- __pthread_create(&thread, NULL, &_hurd_msgport_receive, NULL);
+ __libc_pthread_create (&thread, NULL, &_hurd_msgport_receive, NULL);
/* Record signal thread stack layout for fork() */
__pthread_getattr_np (thread, &attr);
#include <pthread.h>
#include <link.h>
#include <bits/cancelation.h>
-#include <libc-symbols.h>
/* Attribute to indicate thread creation was issued from C11 thrd_create. */
#define ATTR_C11_THREAD ((void*)(uintptr_t)-1)
extern int __pthread_sigmask (int, const sigset_t *, sigset_t *);
libc_hidden_proto (__pthread_sigmask);
+int __libc_pthread_create (pthread_t * thread, const pthread_attr_t * attr,
+ void *(*start_routine) (void *), void *arg);
int __pthread_create (pthread_t *newthread,
const pthread_attr_t *attr,
void *(*start_routine) (void *), void *arg);
libc_hidden_proto (__pthread_condattr_init)
libc_hidden_proto (__pthread_get_cleanup_stack)
-#if IS_IN (libpthread)
-hidden_proto (__pthread_create)
-#endif
+libc_hidden_proto (__pthread_create)
#define ASSERT_TYPE_SIZE(type, size) \
_Static_assert (sizeof (type) == size, \
#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)
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;
{
_init_routine (__libc_stack_end);
}
-
-#ifdef SHARED
-__attribute__ ((constructor))
-static void
-dynamic_init_routine (void)
-{
- _init_routine (__libc_stack_end);
-}
-#endif
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
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
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
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
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
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