[Lldb-commits] [lldb] [lldb][progress] Add progress manager class (PR #81319)

Greg Clayton via lldb-commits lldb-commits at lists.llvm.org
Thu Feb 15 11:31:13 PST 2024


================
@@ -66,3 +67,41 @@ void Progress::ReportProgress() {
                              m_debugger_id);
   }
 }
+
+ProgressManager &ProgressManager::InstanceImpl() {
+  static std::once_flag g_once_flag;
+  static ProgressManager *g_progress_manager = nullptr;
+  std::call_once(g_once_flag, []() {
+    // NOTE: known leak to avoid global destructor chain issues.
+    g_progress_manager = new ProgressManager();
+  });
+  return *g_progress_manager;
+}
----------------
clayborg wrote:

We probably don't need this function and we can just inline the contents into the `static ProgressManager &ProgressManager::Instance()` right?

https://github.com/llvm/llvm-project/pull/81319


More information about the lldb-commits mailing list