Skip to content

Commit

Permalink
Workaround a deadlock in the Swift REPL
Browse files Browse the repository at this point in the history
This was already worked around in rdar://problem/38461035, but it was lost in
a follow-up merge resolution. This reinstates the workaround and adds a test
(from https://bugs.swift.org/browse/SR-7114) to make sure we don't regress this.

apple-llvm-split-commit: ac73e28ffd7b156abbc6a9b3b62db0ba3b4c46f2
apple-llvm-split-dir: lldb/
(cherry picked from commit 510589b)
  • Loading branch information
fredriss authored and JDevlieghere committed Aug 3, 2020
1 parent ee9e313 commit 86294c7
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lldb/source/Plugins/SymbolFile/DWARF/ManualDWARFIndex.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,11 @@ void ManualDWARFIndex::Index() {
// done indexing to make sure we don't pull in all DWARF dies, but we need
// to wait until all units have been indexed in case a DIE in one
// unit refers to another and the indexes accesses those DIEs.
//
// This call can deadlock because we are sometimes holding the module lock so
// don't do it asynchronously.
for (size_t i = 0; i < units_to_index.size(); ++i)
pool.async(extract_fn, i);
pool.wait();
extract_fn(i);

// Now create a task runner that can index each DWARF unit in a
// separate thread so we can index quickly.
Expand Down

0 comments on commit 86294c7

Please sign in to comment.