aboutsummaryrefslogtreecommitdiff
path: root/nptl/init.c
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/init.c
parenta30fb2df74710413014897f527bb565caf7cab9f (diff)
downloadglibc-334fcf2a65f3b58867ce136da767c6c58a3d45ed.tar
glibc-334fcf2a65f3b58867ce136da767c6c58a3d45ed.tar.gz
glibc-334fcf2a65f3b58867ce136da767c6c58a3d45ed.tar.bz2
glibc-334fcf2a65f3b58867ce136da767c6c58a3d45ed.zip
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/init.c')
-rw-r--r--nptl/init.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/nptl/init.c b/nptl/init.c
index dae24f1eac..1f60e92aeb 100644
--- a/nptl/init.c
+++ b/nptl/init.c
@@ -270,6 +270,15 @@ __pthread_initialize_minimal_internal (void)
/* Transfer the old value from the dynamic linker's internal location. */
*__libc_dl_error_tsd () = *(*GL(dl_error_catch_tsd)) ();
GL(dl_error_catch_tsd) = &__libc_dl_error_tsd;
+
+ /* Make __rtld_lock_{,un}lock_recursive use pthread_mutex_{,un}lock,
+ keep the lock count from the ld.so implementation. */
+ GL(dl_rtld_lock_recursive) = (void *) INTUSE (__pthread_mutex_lock);
+ GL(dl_rtld_unlock_recursive) = (void *) INTUSE (__pthread_mutex_unlock);
+ unsigned int rtld_lock_count = GL(dl_load_lock).mutex.__data.__count;
+ GL(dl_load_lock).mutex.__data.__count = 0;
+ while (rtld_lock_count-- > 0)
+ INTUSE (__pthread_mutex_lock) (&GL(dl_load_lock).mutex);
#endif
GL(dl_init_static_tls) = &__pthread_init_static_tls;