summaryrefslogtreecommitdiffstats
path: root/libelf/common.h
diff options
context:
space:
mode:
Diffstat (limited to 'libelf/common.h')
-rw-r--r--libelf/common.h18
1 files changed, 12 insertions, 6 deletions
diff --git a/libelf/common.h b/libelf/common.h
index 9b2a856d..10b53e93 100644
--- a/libelf/common.h
+++ b/libelf/common.h
@@ -92,9 +92,9 @@ allocate_elf (int fildes, void *map_address, int64_t offset, size_t maxsize,
/* Acquire lock for the descriptor and all children. */
static void
__attribute__ ((unused))
-libelf_acquire_all (Elf *elf)
+libelf_acquire_all_children (Elf *elf)
{
- rwlock_wrlock (elf->lock);
+// rwlock_wrlock (elf->lock);
if (elf->kind == ELF_K_AR)
{
@@ -103,7 +103,10 @@ libelf_acquire_all (Elf *elf)
while (child != NULL)
{
if (child->ref_count != 0)
- libelf_acquire_all (child);
+ {
+ rwlock_wrlock(child->lock);
+ libelf_acquire_all_children (child);
+ }
child = child->next;
}
}
@@ -112,7 +115,7 @@ libelf_acquire_all (Elf *elf)
/* Release own lock and those of the children. */
static void
__attribute__ ((unused))
-libelf_release_all (Elf *elf)
+libelf_release_all_children (Elf *elf)
{
if (elf->kind == ELF_K_AR)
{
@@ -121,12 +124,15 @@ libelf_release_all (Elf *elf)
while (child != NULL)
{
if (child->ref_count != 0)
- libelf_release_all (child);
+ {
+ rwlock_unlock (child->lock);
+ libelf_release_all_children (child);
+ }
child = child->next;
}
}
- rwlock_unlock (elf->lock);
+// rwlock_unlock (elf->lock);
}