[Lldb-commits] [PATCH] D40470: DWZ 03/07: Protect DWARFCompileUnit::m_die_array by a new mutex

Jan Kratochvil via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Mon Apr 30 10:46:26 PDT 2018

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

Comment at: source/Plugins/SymbolFile/DWARF/DWARFUnit.cpp:56
+    return 0;
+  std::shared_ptr<void> m_die_array_size_atomic_set(nullptr,
+      [&](void*){ m_die_array_size_atomic = m_die_array.size(); });
clayborg wrote:
> Remove the "m_" prefix on this local variable as that indicates it is a member variable. 
> Might be better to use CleanUp utility from "lldb/Utility/CleanUp.h" instead of a shared pointer to void? Took me a bit to figure out what this was doing. If this is a very accepted C++ way to run a function that is scoped that is fine, but it seems a little unclear what this was doing initially.
Done, done. I have googled the shared_ptr cleanup for this purpose at [[ https://stackoverflow.com/questions/36644263/is-there-a-c-standard-class-to-set-a-variable-to-a-value-at-scope-exit | StackOverflow ]]. Updated, thanks.


More information about the lldb-commits mailing list