From 334fcf2a65f3b58867ce136da767c6c58a3d45ed Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Fri, 8 Aug 2003 07:43:03 +0000 Subject: Update. 2003-08-07 Jakub Jelinek * sysdeps/generic/ldsodefs.h (_rtld_global): Add _dl_rtld_lock_recursive and _dl_rtld_unlock_recursive. * elf/rtld.c (rtld_lock_default_lock_recursive, rtld_lock_default_unlock_recursive): New functions. (dl_main): Initialize _dl_rtld_lock_recursive and _dl_rtld_unlock_recursive. 2003-08-05 Jakub Jelinek * elf/ldconfig.c (main): Append SLIBDIR and LIBDIR to config_file directories instead of prepending. --- linuxthreads/sysdeps/pthread/bits/libc-lock.h | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) (limited to 'linuxthreads/sysdeps/pthread/bits/libc-lock.h') diff --git a/linuxthreads/sysdeps/pthread/bits/libc-lock.h b/linuxthreads/sysdeps/pthread/bits/libc-lock.h index 2697a18371..c0d0debe14 100644 --- a/linuxthreads/sysdeps/pthread/bits/libc-lock.h +++ b/linuxthreads/sysdeps/pthread/bits/libc-lock.h @@ -180,7 +180,6 @@ typedef pthread_key_t __libc_key_t; /* Lock the recursive named lock variable. */ #define __libc_lock_lock_recursive(NAME) __libc_lock_lock ((NAME).mutex) -#define __rtld_lock_lock_recursive(NAME) __libc_lock_lock_recursive (NAME) /* Try to lock the named lock variable. */ #define __libc_lock_trylock(NAME) \ @@ -203,8 +202,23 @@ typedef pthread_key_t __libc_key_t; /* Unlock the recursive named lock variable. */ #define __libc_lock_unlock_recursive(NAME) __libc_lock_unlock ((NAME).mutex) -#define __rtld_lock_unlock_recursive(NAME) __libc_lock_unlock_recursive (NAME) +#if defined _LIBC && defined SHARED +# define __rtld_lock_default_lock_recursive(lock) \ + ++((pthread_mutex_t *)(lock))->__m_count; + +# define __rtld_lock_default_unlock_recursive(lock) \ + --((pthread_mutex_t *)(lock))->__m_count; + +# define __rtld_lock_lock_recursive(NAME) \ + GL(dl_rtld_lock_recursive) (&(NAME).mutex) + +# define __rtld_lock_unlock_recursive(NAME) \ + GL(dl_rtld_unlock_recursive) (&(NAME).mutex) +#else +#define __rtld_lock_lock_recursive(NAME) __libc_lock_lock_recursive (NAME) +#define __rtld_lock_unlock_recursive(NAME) __libc_lock_unlock_recursive (NAME) +#endif /* Define once control variable. */ #if PTHREAD_ONCE_INIT == 0 -- cgit 1.4.1