internal_function
__libdw_findcu (Dwarf *dbg, Dwarf_Off start, bool v4_debug_types)
{
+ mutex_lock (dbg->dwarf_lock);
+
search_tree *tree = v4_debug_types ? &dbg->tu_tree : &dbg->cu_tree;
Dwarf_Off *next_offset
= v4_debug_types ? &dbg->next_tu_offset : &dbg->next_cu_offset;
struct Dwarf_CU **found = eu_tfind (&fake, tree, findcu_cb);
struct Dwarf_CU *result = NULL;
if (found != NULL)
- return *found;
-
- mutex_lock (dbg->dwarf_lock);
+ {
+ mutex_unlock (dbg->dwarf_lock);
+ return *found;
+ }
if (start < *next_offset)
__libdw_seterrno (DWARF_E_INVALID_DWARF);