Avoid locking CTxMemPool::cs recursively in simple cases #19854

pull hebasto wants to merge 6 commits into bitcoin:master from hebasto:200901-mmx3 changing 2 files +16 −13
  1. hebasto commented at 9:49 am on September 1, 2020: member

    This is another step to transit CTxMemPool::cs from RecursiveMutex to Mutex.

    Split out from #19306. Only trivial thread safety annotations and lock assertions added. No new locks. No behavior change.

    Refactoring const uint256 to const uint256& was requested by promag.

    Please note that now, since #19668 has been merged, it is safe to apply AssertLockHeld() macros as they do not swallow compile time Thread Safety Analysis warnings.

  2. refactor: CTxMemPool::UpdateParent() requires CTxMemPool::cs lock
    No change in behavior, the lock is already held at call sites.
    939807768a
  3. refactor: CTxMemPool::UpdateChild() requires CTxMemPool::cs lock
    No change in behavior, the lock is already held at call sites.
    66e47e5e50
  4. refactor: CTxMemPool::ApplyDelta() requires CTxMemPool::cs lock
    No change in behavior, the lock is already held at call sites.
    Also `const uint256` refactored to `const uint256&`.
    7140b31b90
  5. refactor: CTxMemPool::ClearPrioritisation() requires CTxMemPool::cs lock
    No change in behavior, the lock is already held at call sites.
    Also `const uint256` refactored to `const uint256&`.
    fa5fcb032b
  6. refactor: CTxMemPool::GetTotalTxSize() requires CTxMemPool::cs lock
    No change in behavior, the lock is already held at call sites.
    7c4bd0387a
  7. refactor: CTxMemPool::IsUnbroadcastTx() requires CTxMemPool::cs lock
    No change in behavior, the lock is already held at call sites.
    020f0519ec
  8. fanquake added the label Refactoring on Sep 1, 2020
  9. fanquake added the label Mempool on Sep 1, 2020
  10. ajtowns commented at 10:53 am on September 1, 2020: member
    Concept ACK, looks reasonable
  11. DrahtBot commented at 12:26 pm on September 1, 2020: 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:

    • #19478 (Remove CTxMempool::mapLinks data structure member by JeremyRubin)

    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.

  12. vasild approved
  13. vasild commented at 9:11 am on September 2, 2020: member
    ACK 020f0519e
  14. promag commented at 11:49 am on September 2, 2020: member
    Core review ACK 020f0519ec66d9626255b938e1c6c3f7f9aa4017.
  15. jnewbery commented at 10:07 am on September 4, 2020: member
    Code review ACK 020f0519ec66d9626255b938e1c6c3f7f9aa4017
  16. laanwj merged this on Sep 4, 2020
  17. laanwj closed this on Sep 4, 2020

  18. hebasto deleted the branch on Sep 4, 2020
  19. sidhujag referenced this in commit 45b8840fd3 on Sep 9, 2020
  20. Fabcien referenced this in commit ee5de8785e on Sep 22, 2021
  21. DrahtBot locked this on Feb 15, 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-07-01 13:12 UTC

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