[Lldb-commits] [lldb] [lldb-dap] Fix raciness in launch and attach tests (PR #137920)
Pavel Labath via lldb-commits
lldb-commits at lists.llvm.org
Wed Apr 30 01:58:11 PDT 2025
https://github.com/labath commented:
Someone once told me: "Whatever problem you're trying to solve, if you're using atomics, now you've got two problems."
I can't say I've always followed that advice, but I do think that atomics are rarely the right solution to a problem. And I think this is a good example of that.
What you want is not to suppress *a* event (whatever it might be). You want to suppress a very specific event (that is supposed to be generated by the action you're about to perform). That means that something needs to ensure that the other thread reads this flag after you've generated the event. If that's true, then you already have a happens-before relationship and the atomic is not necessary. If it isn't (there is no happens-before), then the atomic will not help.
That said, why is ConnectRemote generating a stopped event in synchronous mode? Maybe that's the bug we should fix?
https://github.com/llvm/llvm-project/pull/137920
More information about the lldb-commits
mailing list