1
0
mirror of https://sourceware.org/git/glibc.git synced 2025-07-29 11:41:21 +03:00

* sysdeps/generic/ldsodefs.h (_dl_load_lock): Declare it here with

__libc_lock_define_recursive.
	* elf/dl-open.c: Don't declare it here any more.
	* elf/dl-close.c: Likewise.
	* elf/dl-lookup.c: Likewise.
	* elf/dl-iteratephdr.c: Likewise.
	* elf/dl-lookup.c (add_dependency): Use __libc_lock_lock_recursive and
	__libc_lock_unlock_recursive.
	* elf/dl-close.c (_dl_close): Likewise
	* elf/dl-iteratephdr.c (__dl_iterate_phdr): Likewise
	* elf/dl-open.c (_dl_open): Likewise

	* sysdeps/generic/bits/libc-lock.h
	(__libc_lock_define_recursive): New macro.
	* sysdeps/generic/bits/stdio-lock.h (_IO_lock_t): Use it.
	(_IO_lock_lock): Use __libc_lock_lock_recursive.
	(_IO_lock_unlock): Use __libc_lock_unlock_recursive.
This commit is contained in:
Roland McGrath
2001-08-23 06:03:42 +00:00
parent 8179dcc108
commit c12aa80156
13 changed files with 91 additions and 72 deletions

View File

@ -23,8 +23,6 @@
#include <stddef.h>
#include <bits/libc-lock.h>
__libc_lock_define (extern, _dl_load_lock)
int
__dl_iterate_phdr (int (*callback) (struct dl_phdr_info *info,
size_t size, void *data), void *data)
@ -34,7 +32,7 @@ __dl_iterate_phdr (int (*callback) (struct dl_phdr_info *info,
int ret = 0;
/* Make sure we are alone. */
__libc_lock_lock (_dl_load_lock);
__libc_lock_lock_recursive (_dl_load_lock);
for (l = _dl_loaded; l != NULL; l = l->l_next)
{
@ -51,7 +49,7 @@ __dl_iterate_phdr (int (*callback) (struct dl_phdr_info *info,
}
/* Release the lock. */
__libc_lock_unlock (_dl_load_lock);
__libc_lock_unlock_recursive (_dl_load_lock);
return ret;
}