[Lldb-commits] [lldb] Allow multiple destroy callbacks in `SBDebugger::SetDestroyCallback()` (PR #89868)

via lldb-commits lldb-commits at lists.llvm.org
Thu Apr 25 16:25:15 PDT 2024


jimingham wrote:

> Hi @jimingham ,
> 
> I have updated the code. Now we have `Add` and `Remove` (with tokens as you suggested). `Set` clears everything then add the given one (also returns a token).
> 
> Thread-safety is done through a `std::lock_guard<std::recursive_mutex>`. This is consistent with some of the other functions/fields.
> 
> Didn't understand one of your comment about "one destroy callback can add/remove others" and how that relates to the code. See my reply in the above.
> 
> Another thing I am not sure is, in python API test, how do I make concurrent calls to these APIs. Do you know if this should be tested (e.g. if other existing functions has similar tests)? If the answer is "yes", do you happen to know what existing test I can see as examples?
> 
> Thanks for your reviews so far. Hope this PR is getting better as we converse.
> 
> Best, Roy

I don't think it's necessary to try to test concurrency.  That tends to be very hard to write a stable test that you know actually tests concurrent access.  Those end up being more trouble than they are worth.

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


More information about the lldb-commits mailing list