[Lldb-commits] [lldb] [LLDB][Stats] Calculate active time to first Bt (PR #161604)

Greg Clayton via lldb-commits lldb-commits at lists.llvm.org
Tue Oct 7 15:42:22 PDT 2025


================
@@ -330,6 +331,11 @@ class TargetStats {
 protected:
   StatsDuration m_create_time;
   StatsDuration m_load_core_time;
+  StatsDuration m_active_time_to_first_bt;
+  // std::atomic doesn't play well with std::optional
+  // so add a simple flag, this should only ever be accessed
+  // by a single thread under the target lock.
+  bool m_first_bt_time_set = false;
----------------
clayborg wrote:

use a `std::once_flag` instead of a bool. That will be thread safe

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


More information about the lldb-commits mailing list