[Lldb-commits] [lldb] Parallelize module loading in POSIX dyld code (PR #130912)

Jonas Devlieghere via lldb-commits lldb-commits at lists.llvm.org
Fri Mar 14 10:14:14 PDT 2025


================
@@ -184,16 +233,37 @@ void DynamicLoaderPOSIXDYLD::DidLaunch() {
 
 Status DynamicLoaderPOSIXDYLD::CanLoadImage() { return Status(); }
 
+void DynamicLoaderPOSIXDYLD::SetLoadedModule(const ModuleSP &module_sp,
+                                             addr_t link_map_addr) {
+  std::unique_lock<std::shared_mutex> lock(m_loaded_modules_rw_mutex);
----------------
JDevlieghere wrote:

Please use LLVM's [RWMutex](https://llvm.org/doxygen/RWMutex_8h.html) instead of a shared_mutex. It's implemented with `shared_mutex` on all platforms but macOS where it's (a lot) slower and limits back deployment. 

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


More information about the lldb-commits mailing list