[PATCH] D157459: Make DWARFContext more thread safe.

Greg Clayton via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 14 15:53:46 PDT 2023


clayborg added a comment.

In D157459#4585664 <https://reviews.llvm.org/D157459#4585664>, @aprantl wrote:

> This patch is protecting access to the fields of DWARFContext.

Yes, this is designed to only protect members of DWARFContext.

> For all the methods returning section pointers, such as `const DWARFDebugLoc *DWARFContext::getDebugLoc()` what are concurrency requirements/guarantees? Do these objects all carry their own mutexes?

If you add more than one mutex then you can deadlock your program due to A/B locking issues. The current fix in DWARFContext::getDebugLoc() ensures that a complete "Loc" member variable is populated in the current DWARFContext object and ensure any other threads wait until the first thread completes the "Loc" contents.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D157459/new/

https://reviews.llvm.org/D157459



More information about the llvm-commits mailing list