================
@@ -731,8 +746,11 @@ class Debugger : public 
std::enable_shared_from_this<Debugger>,
   lldb::TargetSP m_dummy_target_sp;
   Diagnostics::CallbackID m_diagnostics_callback_id;
 
-  lldb_private::DebuggerDestroyCallback m_destroy_callback = nullptr;
-  void *m_destroy_callback_baton = nullptr;
+  std::recursive_mutex m_destroy_callback_mutex;
+  lldb::destroy_callback_token_t m_destroy_callback_next_token = 0;
+  llvm::SmallDenseMap<lldb::destroy_callback_token_t,
+                      std::pair<lldb_private::DebuggerDestroyCallback, void *>>
+      m_destroy_callback_and_baton;
----------------
clayborg wrote:

This doesn't guarantee that callbacks will be called in the right order. This 
should be a simple SmallVector so we can guarantee the order that they are 
called in. This array will not be large and it is easy to search for when 
searching for things by token. Maybe use 2 items and the size of the SmallVector

https://github.com/llvm/llvm-project/pull/89868
_______________________________________________
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to