summaryrefslogtreecommitdiffstats
path: root/libdw/dwarf_begin_elf.c
diff options
context:
space:
mode:
Diffstat (limited to 'libdw/dwarf_begin_elf.c')
-rw-r--r--libdw/dwarf_begin_elf.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/libdw/dwarf_begin_elf.c b/libdw/dwarf_begin_elf.c
index 8c116847..85343088 100644
--- a/libdw/dwarf_begin_elf.c
+++ b/libdw/dwarf_begin_elf.c
@@ -430,13 +430,14 @@ dwarf_begin_elf (Elf *elf, Dwarf_Cmd cmd, Elf_Scn *scngrp)
actual allocation. */
result->mem_default_size = mem_default_size;
result->oom_handler = __libdw_oom;
- if (pthread_key_create (&result->mem_key, NULL) != 0)
+ if (pthread_rwlock_init(&result->mem_rwl, NULL) != 0)
{
free (result);
- __libdw_seterrno (DWARF_E_NOMEM); /* no memory or max pthread keys. */
+ __libdw_seterrno (DWARF_E_NOMEM); /* no memory. */
return NULL;
}
- atomic_init (&result->mem_tail, (uintptr_t)NULL);
+ result->mem_stacks = 0;
+ result->mem_tails = NULL;
if (cmd == DWARF_C_READ || cmd == DWARF_C_RDWR)
{