diff options
author | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2015-11-25 00:47:38 +0100 |
---|---|---|
committer | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2015-11-25 00:47:38 +0100 |
commit | 13cb6162f659446cb7bdb0a6c3cf1d9efe8218f1 (patch) | |
tree | e8cfe525bf3a26dab304ae4f95a92bdf32ab5891 /sysdeps | |
parent | 3df16267afabe8ee7586c45737ca631ec603aec7 (diff) |
Simplify __libc_lock_owner_self by simply using the TCB instead of introducing another TLS variable, whose access might need locking, and thus __libc_lock_owner_self...
Diffstat (limited to 'sysdeps')
-rw-r--r-- | sysdeps/mach/hurd/Versions | 4 | ||||
-rw-r--r-- | sysdeps/mach/hurd/bits/libc-lock.h | 6 | ||||
-rw-r--r-- | sysdeps/mach/hurd/cthreads.c | 13 |
3 files changed, 3 insertions, 20 deletions
diff --git a/sysdeps/mach/hurd/Versions b/sysdeps/mach/hurd/Versions index f760a80401..7cab8e8551 100644 --- a/sysdeps/mach/hurd/Versions +++ b/sysdeps/mach/hurd/Versions @@ -6,7 +6,7 @@ libc { GLIBC_PRIVATE { # Functions shared with the dynamic linker __libc_read; __libc_write; __libc_lseek64; - __libc_lock_self0; __libc_get_lock_self; + __libc_lock_self0; _dl_init_first; } @@ -32,6 +32,6 @@ ld { # functions that must be shared with libc __libc_read; __libc_write; __libc_lseek64; - __libc_lock_self0; __libc_get_lock_self; + __libc_lock_self0; } } diff --git a/sysdeps/mach/hurd/bits/libc-lock.h b/sysdeps/mach/hurd/bits/libc-lock.h index a0f83728e4..b8b7bec8bf 100644 --- a/sysdeps/mach/hurd/bits/libc-lock.h +++ b/sysdeps/mach/hurd/bits/libc-lock.h @@ -35,11 +35,7 @@ typedef struct typedef __libc_lock_recursive_t __rtld_lock_recursive_t; extern char __libc_lock_self0[0]; -/* We have to hide the __libc_lock_self access behind a function call, - otherwise gcc >= 4.9 would try to prefetch the TLS dereference even before - the __LIBC_NO_TLS test is finished... */ -extern void *__libc_get_lock_self(void); -#define __libc_lock_owner_self() (__LIBC_NO_TLS() ? &__libc_lock_self0 : __libc_get_lock_self()) +#define __libc_lock_owner_self() (__LIBC_NO_TLS() ? &__libc_lock_self0 : THREAD_SELF) #else typedef struct __libc_lock_opaque__ __libc_lock_t; diff --git a/sysdeps/mach/hurd/cthreads.c b/sysdeps/mach/hurd/cthreads.c index b309301d93..e25fcd0962 100644 --- a/sysdeps/mach/hurd/cthreads.c +++ b/sysdeps/mach/hurd/cthreads.c @@ -20,19 +20,6 @@ #include <stdlib.h> char __libc_lock_self0[0]; -#if IS_IN (rtld) -/* We don't support static tls relocation so early, but we do not have threads - there either anyway. */ -static char __libc_lock_self[0]; -#else -static __thread char __libc_lock_self[0]; -#endif - -void * -__libc_get_lock_self(void) -{ - return (void*) &__libc_lock_self; -} /* Placeholder for key creation routine from Hurd cthreads library. */ int |