rwlock_fini (p->abbrev_lock);
rwlock_fini (p->split_lock);
mutex_fini (p->src_lock);
+ mutex_fini (p->str_off_base_lock);
/* Free split dwarf one way (from skeleton to split). */
if (p->unit_type == DW_UT_skeleton
Covers dwarf_getsrclines and dwarf_getsrcfiles. */
mutex_define(, src_lock);
+ /* Synchronize access to the str_off_base of this Dwarf_CU.
+ Covers __libdw_str_offsets_base_off. */
+ mutex_define(, str_off_base_lock);
+
/* Memory boundaries of this CU. */
void *startp;
void *endp;
Dwarf_Off off = 0;
if (cu != NULL)
{
+ mutex_lock (cu->str_off_base_lock);
if (cu->str_off_base == (Dwarf_Off) -1)
{
Dwarf_Off dwp_offset;
if (dwarf_formudata (&attr, &base) == 0)
{
cu->str_off_base = off + base;
+ mutex_unlock (cu->str_off_base_lock);
return cu->str_off_base;
}
}
if (cu->version < 5)
{
cu->str_off_base = off;
+ mutex_unlock (cu->str_off_base_lock);
return cu->str_off_base;
}
dbg = cu->dbg;
}
else
- return cu->str_off_base;
+ {
+ mutex_unlock (cu->str_off_base_lock);
+ return cu->str_off_base;
+ }
}
/* No str_offsets_base attribute, we have to assume "zero".
no_header:
if (cu != NULL)
- cu->str_off_base = off;
+ {
+ cu->str_off_base = off;
+ mutex_unlock (cu->str_off_base_lock);
+ }
return off;
}
rwlock_init (newp->abbrev_lock);
rwlock_init (newp->split_lock);
mutex_init (newp->src_lock);
+ mutex_init (newp->str_off_base_lock);
/* v4 debug type units have version == 4 and unit_type == DW_UT_type. */
if (debug_types)