[Lldb-commits] [lldb] [lldb] Add try_lock to SBMutex (PR #164109)

Michael Buch via lldb-commits lldb-commits at lists.llvm.org
Sat Oct 18 11:43:55 PDT 2025


================
@@ -58,3 +58,12 @@ void SBMutex::unlock() const {
   if (m_opaque_sp)
     m_opaque_sp->unlock();
 }
+
+bool SBMutex::try_lock() const {
+  LLDB_INSTRUMENT_VA(this);
+
+  if (m_opaque_sp)
----------------
Michael137 wrote:

I know this is what we do in all the other methods too, but under what circumstances can this be `nullptr`? Isn't it's lifetime at least that of the owning SBMutex?

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


More information about the lldb-commits mailing list