aboutsummaryrefslogtreecommitdiff
path: root/nptl/sysdeps
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2003-08-08 07:43:03 +0000
committerUlrich Drepper <drepper@redhat.com>2003-08-08 07:43:03 +0000
commit334fcf2a65f3b58867ce136da767c6c58a3d45ed (patch)
tree36daebcd9bc1c447dc5bd04ac0e1b310214fa8e6 /nptl/sysdeps
parenta30fb2df74710413014897f527bb565caf7cab9f (diff)
downloadglibc-334fcf2a65f3b58867ce136da767c6c58a3d45ed.zip
glibc-334fcf2a65f3b58867ce136da767c6c58a3d45ed.tar.gz
glibc-334fcf2a65f3b58867ce136da767c6c58a3d45ed.tar.bz2
Update.
2003-08-07 Jakub Jelinek <jakub@redhat.com> * 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 <jakub@redhat.com> * elf/ldconfig.c (main): Append SLIBDIR and LIBDIR to config_file directories instead of prepending.
Diffstat (limited to 'nptl/sysdeps')
-rw-r--r--nptl/sysdeps/pthread/bits/libc-lock.h22
1 files changed, 18 insertions, 4 deletions
diff --git a/nptl/sysdeps/pthread/bits/libc-lock.h b/nptl/sysdeps/pthread/bits/libc-lock.h
index 35bc21b..f7ed88d 100644
--- a/nptl/sysdeps/pthread/bits/libc-lock.h
+++ b/nptl/sysdeps/pthread/bits/libc-lock.h
@@ -248,9 +248,6 @@ typedef pthread_key_t __libc_key_t;
__libc_maybe_call (__pthread_mutex_lock, (&(NAME).mutex), 0)
#endif
-#define __rtld_lock_lock_recursive(NAME) \
- __libc_maybe_call (__pthread_mutex_lock, (&(NAME).mutex), 0)
-
/* Try to lock the named lock variable. */
#if defined _LIBC && (!defined NOT_IN_libc || defined IS_IN_libpthread)
# define __libc_lock_trylock(NAME) \
@@ -319,8 +316,25 @@ typedef pthread_key_t __libc_key_t;
__libc_maybe_call (__pthread_mutex_unlock, (&(NAME)), 0)
#endif
-#define __rtld_lock_unlock_recursive(NAME) \
+#if defined _LIBC && defined SHARED
+# define __rtld_lock_default_lock_recursive(lock) \
+ ++((pthread_mutex_t *)(lock))->__data.__count;
+
+# define __rtld_lock_default_unlock_recursive(lock) \
+ --((pthread_mutex_t *)(lock))->__data.__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_maybe_call (__pthread_mutex_lock, (&(NAME).mutex), 0)
+
+# define __rtld_lock_unlock_recursive(NAME) \
__libc_maybe_call (__pthread_mutex_unlock, (&(NAME).mutex), 0)
+#endif
/* Define once control variable. */
#if PTHREAD_ONCE_INIT == 0