aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/IR/Function.cpp
diff options
context:
space:
mode:
authorPavel Labath <pavel@labath.sk>2024-10-17 17:29:38 +0200
committerGitHub <noreply@github.com>2024-10-17 17:29:38 +0200
commit98b419ca7688aa2823df1e87f58051aaa8d9c37f (patch)
tree1510f532a03fc9dfda1d3c635b89d29488708e3d /llvm/lib/IR/Function.cpp
parent4897fc44a918b8da886d48082b6cf004cf3ffe0b (diff)
downloadllvm-98b419ca7688aa2823df1e87f58051aaa8d9c37f.zip
llvm-98b419ca7688aa2823df1e87f58051aaa8d9c37f.tar.gz
llvm-98b419ca7688aa2823df1e87f58051aaa8d9c37f.tar.bz2
[lldb] Don't exit the main loop when in runs out of things to listen on (#112565)
This behavior made sense in the beginning as the class was completely single threaded, so if the source count ever reached zero, there was no way to add new ones. In https://reviews.llvm.org/D131160, the class gained the ability to add events (callbacks) from other threads, which means that is no longer the case (and indeed, one possible use case for this class -- acting as a sort of arbiter for multiple threads wanting to run code while making sure it runs serially -- has this class sit in an empty Run call most of the time). I'm not aware of us having a use for such a thing right now, but one of my tests in another patch turned into something similar by accident. Another problem with the current approach is that, in a distributed/dynamic setup (multiple things using the main loop without a clear coordinator), one can never be sure whether unregistering a specific event will terminate the loop (it depends on whether there are other listeners). We had this problem in lldb-platform.cpp, where we had to add an additional layer of synchronization to avoid premature termination. We can remove this if we can rely on the loop terminating only when we tell it to.
Diffstat (limited to 'llvm/lib/IR/Function.cpp')
0 files changed, 0 insertions, 0 deletions