mirror of
https://sourceware.org/git/glibc.git
synced 2025-07-29 11:41:21 +03:00
Update.
* init.c (pthread_functions): New variable. (__pthread_initialize_minimal): Pass pointer to pthread_functions (or NULL) to __libc_pthread_init. * forward.c: Rewrite to use __libc:pthread_functions array to get function addresses. * sysdeps/unix/sysv/linux/fork.h: Remove __libc_pthread_init prototype. * sysdeps/unix/sysv/linux/libc_pthread_init.c (__libc_pthread_init): Take new parameter. Copy content of variable pointed to by it to __libc_pthread_init. * pthreadP.h (struct pthread_functions): New type. (__libc_pthread_init): Declare. * pthread_attr_destroy.c: Add namespace protected alias. * pthread_attr_getdetachstate.c: Likewise. * pthread_attr_getinheritsched.c: Likewise. * pthread_attr_getschedparam.c: Likewise. * pthread_attr_getschedpolicy.c: Likewise. * pthread_attr_getscope.c: Likewise. * pthread_attr_setdetachstate.c: Likewise. * pthread_attr_setinheritsched.c: Likewise. * pthread_attr_setschedparam.c: Likewise. * pthread_attr_setschedpolicy.c: Likewise. * pthread_attr_setscope.c: Likewise. * pthread_cond_broadcast.c: Likewise. * pthread_cond_destroy.c: Likewise. * pthread_cond_init.c: Likewise. * pthread_cond_signal.c: Likewise. * pthread_cond_wait.c: Likewise. * pthread_condattr_destroy.c: Likewise. * pthread_condattr_init.c: Likewise. * pthread_equal.c: Likewise. * pthread_exit.c: Likewise. * pthread_getschedparam.c: Likewise. * pthread_self.c: Likewise. * pthread_setcancelstate.c: Likewise. * pthread_setschedparam.c: Likewise. * pthread_mutex_destroy.c: Likewise. * pthread_mutex_init.c: Likewise. * pthreadP.h: Add prototypes for the aliases.
This commit is contained in:
@ -21,6 +21,8 @@
|
||||
#include <list.h>
|
||||
#include "fork.h"
|
||||
#include <tls.h>
|
||||
#include <string.h>
|
||||
#include <pthreadP.h>
|
||||
#include <bits/libc-lock.h>
|
||||
|
||||
|
||||
@ -28,9 +30,10 @@ static struct fork_handler pthread_child_handler;
|
||||
|
||||
|
||||
void
|
||||
__libc_pthread_init (ptr, reclaim)
|
||||
__libc_pthread_init (ptr, reclaim, functions)
|
||||
unsigned long int *ptr;
|
||||
void (*reclaim) (void);
|
||||
const struct pthread_functions *functions;
|
||||
{
|
||||
/* Remember the pointer to the generation counter in libpthread. */
|
||||
__fork_generation_pointer = ptr;
|
||||
@ -41,6 +44,14 @@ __libc_pthread_init (ptr, reclaim)
|
||||
/* The fork handler needed by libpthread. */
|
||||
list_add_tail (&pthread_child_handler.list, &__fork_child_list);
|
||||
|
||||
#ifdef SHARED
|
||||
/* We copy the content of the variable pointed to by the FUNCTIONS
|
||||
parameter to one in libc.so since this means access to the array
|
||||
can be done with one memory access instead of two. */
|
||||
memcpy (&__libc_pthread_functions, functions,
|
||||
sizeof (__libc_pthread_functions));
|
||||
#endif
|
||||
|
||||
/* We have a macro which is used in asm code describing data layout.
|
||||
Make sure it does not get out of date. */
|
||||
if (offsetof (struct pthread, header.data.multiple_threads)
|
||||
|
Reference in New Issue
Block a user