summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--pthread/pt-initialize.c6
-rw-r--r--sysdeps/pthread/libc-lockP.h22
-rw-r--r--sysdeps/pthread/pthread-functions.h6
3 files changed, 28 insertions, 6 deletions
diff --git a/pthread/pt-initialize.c b/pthread/pt-initialize.c
index 4435a36..bb3e1fc 100644
--- a/pthread/pt-initialize.c
+++ b/pthread/pt-initialize.c
@@ -68,9 +68,9 @@ static const struct pthread_functions pthread_functions =
.ptr_pthread_rwlock_rdlock = __pthread_rwlock_rdlock,
.ptr_pthread_rwlock_wrlock = __pthread_rwlock_wrlock,
.ptr_pthread_rwlock_unlock = __pthread_rwlock_unlock,
- .ptr_pthread_key_create = __pthread_key_create,
- .ptr_pthread_getspecific = __pthread_getspecific,
- .ptr_pthread_setspecific = __pthread_setspecific,
+ .ptr___pthread_key_create = __pthread_key_create,
+ .ptr___pthread_getspecific = __pthread_getspecific,
+ .ptr___pthread_setspecific = __pthread_setspecific,
.ptr__IO_flockfile = _cthreads_flockfile,
.ptr__IO_funlockfile = _cthreads_funlockfile,
.ptr__IO_ftrylockfile = _cthreads_ftrylockfile,
diff --git a/sysdeps/pthread/libc-lockP.h b/sysdeps/pthread/libc-lockP.h
index c04881d..9e034ad 100644
--- a/sysdeps/pthread/libc-lockP.h
+++ b/sysdeps/pthread/libc-lockP.h
@@ -22,6 +22,9 @@
#include <pthread.h>
#include <pthread-functions.h>
+/* Type for key to thread-specific data. */
+typedef pthread_key_t __libc_key_t;
+
/* If we check for a weakly referenced symbol and then perform a
normal jump to it te code generated for some platforms in case of
PIC is unnecessarily slow. What would happen is that the function
@@ -43,6 +46,12 @@
(__libc_pthread_functions_init ? PTHFCT_CALL (ptr_##FUNC, ARGS) : ELSE)
# define __libc_ptf_call_always(FUNC, ARGS) \
PTHFCT_CALL (ptr_##FUNC, ARGS)
+#elif IS_IN (libpthread)
+# define PTFAVAIL(NAME) 1
+# define __libc_ptf_call(FUNC, ARGS, ELSE) \
+ FUNC ARGS
+# define __libc_ptf_call_always(FUNC, ARGS) \
+ FUNC ARGS
#else
# define PTFAVAIL(NAME) (NAME != NULL)
# define __libc_ptf_call(FUNC, ARGS, ELSE) \
@@ -51,6 +60,19 @@
FUNC ARGS
#endif
+/* Create thread-specific key. */
+#define __libc_key_create(KEY, DESTRUCTOR) \
+ __libc_ptf_call (__pthread_key_create, (KEY, DESTRUCTOR), 1)
+
+/* Get thread-specific data. */
+#define __libc_getspecific(KEY) \
+ __libc_ptf_call (__pthread_getspecific, (KEY), NULL)
+
+/* Set thread-specific data. */
+#define __libc_setspecific(KEY, VALUE) \
+ __libc_ptf_call (__pthread_setspecific, (KEY, VALUE), 0)
+
+
/* Functions that are used by this file and are internal to the GNU C
library. */
diff --git a/sysdeps/pthread/pthread-functions.h b/sysdeps/pthread/pthread-functions.h
index db30f13..c121936 100644
--- a/sysdeps/pthread/pthread-functions.h
+++ b/sysdeps/pthread/pthread-functions.h
@@ -121,9 +121,9 @@ struct pthread_functions
int (*ptr_pthread_rwlock_rdlock) (pthread_rwlock_t *);
int (*ptr_pthread_rwlock_wrlock) (pthread_rwlock_t *);
int (*ptr_pthread_rwlock_unlock) (pthread_rwlock_t *);
- int (*ptr_pthread_key_create) (pthread_key_t *, void (*) (void *));
- void *(*ptr_pthread_getspecific) (pthread_key_t);
- int (*ptr_pthread_setspecific) (pthread_key_t, const void *);
+ int (*ptr___pthread_key_create) (pthread_key_t *, void (*) (void *));
+ void *(*ptr___pthread_getspecific) (pthread_key_t);
+ int (*ptr___pthread_setspecific) (pthread_key_t, const void *);
void (*ptr__IO_flockfile) (FILE *);
void (*ptr__IO_funlockfile) (FILE *);
int (*ptr__IO_ftrylockfile) (FILE *);