txmempool: add thread safety annotations #22003

pull ajtowns wants to merge 1 commits into bitcoin:master from ajtowns:202105-mempoolguards changing 2 files +8 −7
  1. ajtowns commented at 2:34 pm on May 20, 2021: member
    Add missing thread safety guards to CTxMempool members.
  2. hebasto commented at 2:35 pm on May 20, 2021: member
    Concept ACK.
  3. in src/txmempool.h:482 in 05d319dc9e outdated
    478@@ -479,21 +479,21 @@ class CTxMemPool
    479 protected:
    480     const int m_check_ratio; //!< Value n means that 1 times in n we check.
    481     std::atomic<unsigned int> nTransactionsUpdated{0}; //!< Used by getblocktemplate to trigger CreateNewBlock() invocation
    482-    CBlockPolicyEstimator* minerPolicyEstimator;
    483+    CBlockPolicyEstimator* minerPolicyEstimator GUARDED_BY(cs);
    


    vasild commented at 3:22 pm on May 20, 2021:

    This is only ever modified by assigning it in the constructor, can be const like m_check_ratio.

    0    CBlockPolicyEstimator* const minerPolicyEstimator;
    

    ajtowns commented at 2:14 am on May 21, 2021:
    And the object protects itself via its own mutex. Done.
  4. hebasto approved
  5. hebasto commented at 3:25 pm on May 20, 2021: member
    ACK 05d319dc9ed2a33f2a08a698dc6d8b74ff77229b, I have reviewed the code and it looks OK, I agree it can be merged.
  6. DrahtBot added the label Mempool on May 20, 2021
  7. practicalswift commented at 6:33 pm on May 20, 2021: contributor

    Concept ACK

    Thanks for making the thread-safety annotations more complete!

  8. txmempool: add thread safety annotations 793b268284
  9. ajtowns force-pushed on May 21, 2021
  10. DrahtBot commented at 4:05 am on May 21, 2021: member

    The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

    Conflicts

    Reviewers, this pull request conflicts with the following ones:

    • #21618 (WIP: Reduce MinRelayFee slower when Mempool utilised and faster when needed. by rebroad)

    If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first.

  11. hebasto approved
  12. hebasto commented at 5:42 am on May 21, 2021: member
    re-ACK 793b2682841b0bdd7eb93163e34728765cfe52b2, only suggested changes since my previous review.
  13. MarcoFalke commented at 6:27 am on May 21, 2021: member
    cr ACK 793b2682841b0bdd7eb93163e34728765cfe52b2
  14. MarcoFalke merged this on May 21, 2021
  15. MarcoFalke closed this on May 21, 2021

  16. vasild commented at 8:06 am on May 21, 2021: member
    ACK 793b2682841b0bdd7eb93163e34728765cfe52b2
  17. sidhujag referenced this in commit 6887f7bc36 on May 21, 2021
  18. Fabcien referenced this in commit e92930083c on Apr 6, 2022
  19. gwillen referenced this in commit b9027c994c on Jun 1, 2022
  20. DrahtBot locked this on Aug 18, 2022

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: 2024-11-23 12:12 UTC

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