[Lldb-commits] [lldb] [lldb] Wrap Target::GetAPIMutex() into a Lockable handle (NFC) (PR #212872)

Pranav Kant via lldb-commits lldb-commits at lists.llvm.org
Wed Aug 19 09:05:36 PDT 2026


================
@@ -464,7 +464,8 @@ static Status ResumeNewPlan(StoppedExecutionContext exe_ctx,
   process->GetThreadList().SetSelectedThreadByID(thread->GetID());
 
   // Release the run lock but keep the API lock.
-  std::unique_lock<std::recursive_mutex> api_lock = exe_ctx.AllowResume();
+  TargetAPIMutex api_mutex = exe_ctx.AllowResume();
+  std::lock_guard<TargetAPIMutex> guard(api_mutex, std::adopt_lock);
----------------
pranavk wrote:

i think Wthread-safety-analysis is new in libcxx. One would need to do use two stage builds. i did my first stage build building libcxx from llvm and then used that built libcxx to build lldb in stage2. It also needs to be enabled (-DCMAKE_CXX_FLAGS=-Werror=thread-safety-analysis) as it's disabled by default.

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


More information about the lldb-commits mailing list