[Lldb-commits] [lldb] Convert the StackFrameList mutex to a shared mutex. (PR #117252)
via lldb-commits
lldb-commits at lists.llvm.org
Fri Dec 6 17:53:35 PST 2024
jimingham wrote:
Does this look better?
The situation is that there are really only three "writer" API's: `GetOnlyConcreteFramesUpTo`,` `Clear` and the second half of `GetFramesUpTo`, and only Clear is called with the intention of changing the list contents. And none of these were client API's. All the client API's were formally readers - they shouldn't have to know that we update frames lazily. So the responsibilities were already pretty strictly limited.
But clearer is for sure better, so I renamed `GetOnlyConcreteFramesUpTo` to `FetchOnlyConcreteFramesUpTo` and moved the second half of GetFramesUpTo into `FetchFramesUpTo`. Those and Clear are the only places where the list is actually mutated. `Clear` doesn't need to do any dance, since it's a client API and intends to change the list. Other than that, clients who want to read the list need to acquire the shared mutex, if the `Fetch` functions need to add frames to fulfill that request, that should happen silently when some client asks for more frames than have been fetched.
https://github.com/llvm/llvm-project/pull/117252
More information about the lldb-commits
mailing list