We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 26456d7 commit ba38befCopy full SHA for ba38bef
lldb/include/lldb/Core/ModuleList.h
@@ -500,6 +500,9 @@ class ModuleList {
500
bool AnyOf(
501
std::function<bool(lldb_private::Module &module)> const &callback) const;
502
503
+ /// Atomically swaps the contents of this module list with \a other.
504
+ void Swap(ModuleList &other);
505
+
506
protected:
507
// Class typedefs.
508
typedef std::vector<lldb::ModuleSP>
lldb/source/Core/ModuleList.cpp
@@ -1295,3 +1295,10 @@ bool ModuleList::AnyOf(
1295
1296
return false;
1297
}
1298
1299
1300
+void ModuleList::Swap(ModuleList &other) {
1301
+ // scoped_lock locks both mutexes at once.
1302
+ std::scoped_lock lock(m_modules_mutex, other.m_modules_mutex);
1303
+ m_modules.swap(other.m_modules);
1304
+}
0 commit comments