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-
ajtowns commented at 2:34 pm on May 20, 2021: memberAdd missing thread safety guards to CTxMempool members.
-
hebasto commented at 2:35 pm on May 20, 2021: memberConcept ACK.
-
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
likem_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.hebasto approvedhebasto commented at 3:25 pm on May 20, 2021: memberACK 05d319dc9ed2a33f2a08a698dc6d8b74ff77229b, I have reviewed the code and it looks OK, I agree it can be merged.DrahtBot added the label Mempool on May 20, 2021practicalswift commented at 6:33 pm on May 20, 2021: contributorConcept ACK
Thanks for making the thread-safety annotations more complete!
txmempool: add thread safety annotations 793b268284ajtowns force-pushed on May 21, 2021DrahtBot commented at 4:05 am on May 21, 2021: memberThe 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.
hebasto approvedMarcoFalke commented at 6:27 am on May 21, 2021: membercr ACK 793b2682841b0bdd7eb93163e34728765cfe52b2MarcoFalke merged this on May 21, 2021MarcoFalke closed this on May 21, 2021
vasild commented at 8:06 am on May 21, 2021: memberACK 793b2682841b0bdd7eb93163e34728765cfe52b2sidhujag referenced this in commit 6887f7bc36 on May 21, 2021Fabcien referenced this in commit e92930083c on Apr 6, 2022gwillen referenced this in commit b9027c994c on Jun 1, 2022DrahtBot 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 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
More mirrored repositories can be found on mirror.b10c.me