================
@@ -511,31 +513,61 @@ template <typename Instance> class PluginInstances {
   }
 
   typename Instance::CallbackType GetCallbackAtIndex(uint32_t idx) {
-    if (const Instance *instance = GetInstanceAtIndex(idx))
-      return instance->create_callback;
+    std::lock_guard<std::mutex> lock(m_mutex);
+    uint32_t count = 0;
+    for (const auto &instance : m_instances) {
+      if (!instance.enabled)
+        continue;
----------------
ashgti wrote:

This pattern is repeated a few times here and below, could we use 
`GetSnapshot()` to simplify this?

https://github.com/llvm/llvm-project/pull/184452
_______________________________________________
lldb-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to