The old __pthread_self hidden prototype did not work because there
was no implementation. (Hurd uses __pthread_self as a variable,
so it's prudent to avoid this identifier on Linux.) A macro is needed
so that nptl/pthread_self.c can still be built (static inline would
prevent that) and __extern_inline does not work due to the definition
of THREAD_SELF on hppa.
---
nptl/pthread_self.c | 2 +-
sysdeps/nptl/pthreadP.h | 5 ++++-
2 files changed, 5 insertions(+), 2 deletions(-)
@@ -20,7 +20,7 @@
#include <tls.h>
pthread_t
-pthread_self (void)
+(pthread_self) (void)
{
return (pthread_t) THREAD_SELF;
}
@@ -520,7 +520,6 @@ extern int __pthread_once (pthread_once_t *once_control,
libc_hidden_proto (__pthread_once)
extern int __pthread_atfork (void (*prepare) (void), void (*parent) (void),
void (*child) (void));
-extern pthread_t __pthread_self (void);
extern int __pthread_equal (pthread_t thread1, pthread_t thread2);
extern int __pthread_detach (pthread_t th);
libc_hidden_proto (__pthread_detach)
@@ -698,6 +697,10 @@ int __pthread_attr_extension (struct pthread_attr *attr) attribute_hidden
int __pthread_attr_copy (pthread_attr_t *target, const pthread_attr_t *source);
libc_hidden_proto (__pthread_attr_copy)
+/* This cannot be an inline function because a static inline conflict
+ on hppa. */
+#define pthread_self() ((pthread_t) THREAD_SELF)
+
/* Returns 0 if POL is a valid scheduling policy. */
static inline int
check_sched_policy_attr (int pol)