Skip to content

Commit ead9772

Browse files
committed
[lldb] Use ModueList::Swap in ProcessModulesToAdd
1 parent ba38bef commit ead9772

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

lldb/source/Plugins/LanguageRuntime/Swift/SwiftLanguageRuntime.cpp

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -461,11 +461,7 @@ void SwiftLanguageRuntimeImpl::ProcessModulesToAdd() {
461461
// A snapshot of the modules to be processed. This is necessary because
462462
// AddModuleToReflectionContext may recursively call into this function again.
463463
ModuleList modules_to_add_snapshot;
464-
{
465-
std::lock_guard<std::recursive_mutex> lock(m_modules_to_add.GetMutex());
466-
modules_to_add_snapshot = m_modules_to_add;
467-
m_modules_to_add.Clear();
468-
}
464+
modules_to_add_snapshot.Swap(m_modules_to_add);
469465

470466
if (modules_to_add_snapshot.IsEmpty())
471467
return;

0 commit comments

Comments
 (0)