[Lldb-commits] [PATCH] D100418: [lldb] [MainLoop] Support multiple callbacks per signal

Pavel Labath via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Wed Apr 14 11:19:44 PDT 2021


labath added a comment.

I've been thinking about whether this should be done here, or via a separate multiplexer entity. It's not clear to me which one is cleaner so I suppose we can go with what you have done here.

That said, I'm not too happy about this callback_id business. IIUC, it's only there to enable removing a specific callback (because you can't have a set of std::functions). But there are other ways to achieve that, and they don't leak this detail to the users. One option would be to hold the callbacks in a std::list, and use the (stable) iterator as the ID....

It could also use a test... something like, register a callback, fire a signal and check it's called, registers a second callback and check that both are called, unregister the first one and check that only the second one is called, ...


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

https://reviews.llvm.org/D100418



More information about the lldb-commits mailing list