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/pthread.c | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'linuxthreads/pthread.c') diff --git a/linuxthreads/pthread.c b/linuxthreads/pthread.c index f7081139b2..f261f8e8f4 100644 --- a/linuxthreads/pthread.c +++ b/linuxthreads/pthread.c @@ -588,6 +588,15 @@ static void pthread_initialize(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 *) __pthread_mutex_lock; + GL(dl_rtld_unlock_recursive) = (void *) __pthread_mutex_unlock; + unsigned int rtld_lock_count = GL(dl_load_lock).mutex.__m_count; + GL(dl_load_lock).mutex.__m_count = 0; + while (rtld_lock_count-- > 0) + __pthread_mutex_lock (&GL(dl_load_lock).mutex); #endif #ifdef USE_TLS -- cgit v1.2.3