mirror of
https://sourceware.org/git/glibc.git
synced 2025-08-01 10:06:57 +03:00
nptl: Move pthread_once and __pthread_once into libc
And also the fork generation counter, __fork_generation. This eliminates the need for __fork_generation_pointer. call_once remains in libpthread and calls the exported __pthread_once symbol. pthread_once and __pthread_once have been moved using scripts/move-symbol-to-libc.py. Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
This commit is contained in:
@ -19,7 +19,8 @@
|
||||
#include "pthreadP.h"
|
||||
#include <futex-internal.h>
|
||||
#include <atomic.h>
|
||||
|
||||
#include <libc-lockP.h>
|
||||
#include <shlib-compat.h>
|
||||
|
||||
unsigned long int __fork_generation attribute_hidden;
|
||||
|
||||
@ -132,7 +133,7 @@ __pthread_once_slow (pthread_once_t *once_control, void (*init_routine) (void))
|
||||
}
|
||||
|
||||
int
|
||||
__pthread_once (pthread_once_t *once_control, void (*init_routine) (void))
|
||||
___pthread_once (pthread_once_t *once_control, void (*init_routine) (void))
|
||||
{
|
||||
/* Fast path. See __pthread_once_slow. */
|
||||
int val;
|
||||
@ -142,5 +143,11 @@ __pthread_once (pthread_once_t *once_control, void (*init_routine) (void))
|
||||
else
|
||||
return __pthread_once_slow (once_control, init_routine);
|
||||
}
|
||||
weak_alias (__pthread_once, pthread_once)
|
||||
hidden_def (__pthread_once)
|
||||
versioned_symbol (libc, ___pthread_once, __pthread_once, GLIBC_2_34);
|
||||
libc_hidden_ver (___pthread_once, __pthread_once)
|
||||
|
||||
versioned_symbol (libc, ___pthread_once, pthread_once, GLIBC_2_34);
|
||||
#if OTHER_SHLIB_COMPAT (libpthread, GLIBC_2_0, GLIBC_2_34)
|
||||
compat_symbol (libpthread, ___pthread_once, __pthread_once, GLIBC_2_0);
|
||||
compat_symbol (libpthread, ___pthread_once, pthread_once, GLIBC_2_0);
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user