jankratochvil marked an inline comment as done.
jankratochvil added inline comments.


================
Comment at: source/Plugins/SymbolFile/DWARF/DWARFUnit.h:181
+  // ExtractDIEsIfNeeded() will keep m_die_array populated forever.
+  uint32_t m_die_array_usecount = 0;
   // GetUnitDIEPtrOnly() needs to return pointer to the first DIE.
----------------
clayborg wrote:
> Why don't we expose the llvm::sys::RWMutex for BuildAddressRangeTable and 
> SymbolFileDWARF::Index? Then they can just grab the read lock?
Wouldn't you prefer an RAII lock (`DWARFUnit::ScopedExtractDIEs`) instead of 
the mutex exposure?

There are two mutexes (`m_die_array_mutex` and `m_die_array_scoped_mutex`), I 
tried it using a single mutex (as you IMO suggest) but then one needs to 
downgrade exclusive->shared lock there which requires a `retry` label there so 
I did not like the single lock ([[ 
https://people.redhat.com/jkratoch/mutex2.patch | mutex2.patch ]]).



https://reviews.llvm.org/D40470



_______________________________________________
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to