rpc: Remove unused boost::this_thread::interruption_point #17382

pull MarcoFalke wants to merge 1 commits into bitcoin:master from MarcoFalke:1911-noBoostThreadInt changing 2 files +0 −7
  1. MarcoFalke commented at 7:09 PM on November 5, 2019: member

    There are predefined interruption points for boost::thread: https://www.boost.org/doc/libs/1_71_0/doc/html/thread/thread_management.html#interruption_points

    However, the rpc threads are std::thread, which does not have an std::thread::interrupt member function to request interruption: https://dev.visucore.com/bitcoin/doxygen/httpserver_8cpp.html#ae1a63374e18b9abd348eb74e4243ea34

    Thus, the interruption points can be removed.

  2. rpc: Remove unused boost::this_thread::interruption_point fa5facd3e7
  3. MarcoFalke added the label Refactoring on Nov 5, 2019
  4. laanwj commented at 7:15 PM on November 5, 2019: member

    ACK fa5facd3e72b6d61374b0b93b722b55e2b090020, this does nothing.

    If the goal is to be interruptible, add checks for IsRPCRunning() instead (assuming RPC code).

  5. practicalswift commented at 9:09 PM on November 5, 2019: contributor

    ACK fa5facd3e72b6d61374b0b93b722b55e2b090020

    Good catch!

  6. laanwj referenced this in commit 45e65376ac on Nov 5, 2019
  7. laanwj merged this on Nov 5, 2019
  8. laanwj closed this on Nov 5, 2019

  9. laanwj commented at 11:26 PM on November 5, 2019: member

    I wouldn't be sure about the ones in validation and indexing (the script check threads are part of a thread group, after all), but aren't these untriggerable as well?

    src/wallet/db.cpp:    boost::this_thread::interruption_point();
    src/wallet/db.cpp:    boost::this_thread::interruption_point();
    src/wallet/db.cpp:            boost::this_thread::interruption_point();
    

    Edit: oh, maybe not, at least BerkeleyBatch::PeriodicFlush(BerkeleyDatabase& database) could be called from a scheduler thread. The interruption point on open / construction is weirder.

  10. sidhujag referenced this in commit 06ab951d15 on Nov 7, 2019
  11. MarcoFalke deleted the branch on Nov 7, 2019
  12. jasonbcox referenced this in commit 96027f8aee on Nov 4, 2020
  13. sidhujag referenced this in commit 721dd7c9fe on Nov 10, 2020
  14. MarcoFalke locked this on Dec 16, 2021

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-04-17 06:14 UTC

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