Add shared_ptr callback support #34

pull ryanofsky wants to merge 7 commits into bitcoin-core:master from ryanofsky:pr/shareimpl changing 6 files +141 −38
  1. ryanofsky commented at 4:49 PM on April 10, 2020: collaborator

    This is needed after https://github.com/bitcoin/bitcoin/pull/18338 which changed handleNotifications() Notifications& callback argument to std::shared_ptr<Notifications>.

    Easiest way to support this was to change ProxyServerBase reference from a raw pointer to shared pointer and make necessary BuildField changes to pass along the shared_ptr. Alternative might have been to add more generic cleanup support to ProxyServerBase instead of hardcoding shared_ptr.

    The change also required making the ReadField callback overload more generic, which was a straightforward but kind of big change that touched a lot of code.

    There weren't any unit tests for callback support previously, so a lot of new test coverage was added. It includes coverage for shared_ptr lifetime correctness, making sure there's an IPC call decrementing server shared_ptr reference count when client shared_ptr proxy is reset.

  2. Add test coverage for thread map and callbacks ab4568bbbd
  3. Fix bugs in PassField overload for callback objects passed by reference
    Arguments to ProxyClientBase constructor were out of date and this PassField
    overload didn't have test coverage or usage in bitcoin
    da489bef3f
  4. Add CustomReadField priority param for more flexibility and consistency with CustomBuildField 39bbf74a08
  5. Add support for passing shared_ptrs without extending lifetime 5390a1b116
  6. Add saveCallback / callbackSaved test setup 27f8a35ec0
  7. Add shared_ptr ownership and lifetime support 31b4f1be84
  8. Add comment saying how to fix clientInvoke missing Proxy.Context assert 9ce0335b26
  9. ryanofsky force-pushed on Apr 10, 2020
  10. ryanofsky merged this on Apr 10, 2020
  11. ryanofsky closed this on Apr 10, 2020

  12. ryanofsky referenced this in commit 6d7c88b7bb on Jun 11, 2025
  13. ryanofsky referenced this in commit 241f9ce1df on Jun 13, 2025
  14. bitcoin-core locked this on Jun 25, 2025

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin-core/libmultiprocess. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-04-18 13:30 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me