diff options
Diffstat (limited to 'sysdeps/pthread/libc-lockP.h')
-rw-r--r-- | sysdeps/pthread/libc-lockP.h | 22 |
1 files changed, 22 insertions, 0 deletions
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. */ |