Skip to content

Commit c5ffbd8

Browse files
authored
[lldb][plugin] Clear in same thread as set
Here we were initializing & locking a mutex in a thread, while releasing it in the parent which may/often turned out to be a different thread (shared_mutex::unlock_shared is undefined behavior if called from a thread that doesn't hold the lock). I'm not quite sure what the expectation is here as the variable is never used, so instead I've just reset in same thread as which it was set to ensure its freed in thread holding lock.
1 parent 416cdcf commit c5ffbd8

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

lldb/source/Plugins/SymbolFile/DWARF/ManualDWARFIndex.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,7 @@ void ManualDWARFIndex::Index() {
121121
units_to_index.size());
122122
for_each_unit([&clear_cu_dies](size_t, size_t idx, DWARFUnit *unit) {
123123
clear_cu_dies[idx] = unit->ExtractDIEsScoped();
124+
ckear_cu_duex[idx].reset();
124125
});
125126

126127
// Now index all DWARF unit in parallel.

0 commit comments

Comments
 (0)