Avoid locking CTxMemPool::cs recursively in simple cases#19854
Merged
laanwj merged 6 commits intobitcoin:masterfrom Sep 4, 2020
Merged
Avoid locking CTxMemPool::cs recursively in simple cases#19854laanwj merged 6 commits intobitcoin:masterfrom
laanwj merged 6 commits intobitcoin:masterfrom
Conversation
No change in behavior, the lock is already held at call sites.
No change in behavior, the lock is already held at call sites.
No change in behavior, the lock is already held at call sites. Also `const uint256` refactored to `const uint256&`.
No change in behavior, the lock is already held at call sites. Also `const uint256` refactored to `const uint256&`.
No change in behavior, the lock is already held at call sites.
No change in behavior, the lock is already held at call sites.
35 tasks
Contributor
|
Concept ACK, looks reasonable |
Contributor
|
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers. ConflictsReviewers, this pull request conflicts with the following ones:
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. |
vasild
approved these changes
Sep 2, 2020
Contributor
|
Core review ACK 020f051. |
Contributor
|
Code review ACK 020f051 |
This was referenced Sep 4, 2020
sidhujag
pushed a commit
to syscoin/syscoin
that referenced
this pull request
Sep 9, 2020
…le cases 020f051 refactor: CTxMemPool::IsUnbroadcastTx() requires CTxMemPool::cs lock (Hennadii Stepanov) 7c4bd03 refactor: CTxMemPool::GetTotalTxSize() requires CTxMemPool::cs lock (Hennadii Stepanov) fa5fcb0 refactor: CTxMemPool::ClearPrioritisation() requires CTxMemPool::cs lock (Hennadii Stepanov) 7140b31 refactor: CTxMemPool::ApplyDelta() requires CTxMemPool::cs lock (Hennadii Stepanov) 66e47e5 refactor: CTxMemPool::UpdateChild() requires CTxMemPool::cs lock (Hennadii Stepanov) 9398077 refactor: CTxMemPool::UpdateParent() requires CTxMemPool::cs lock (Hennadii Stepanov) Pull request description: This is another step to transit `CTxMemPool::cs` from `RecursiveMutex` to `Mutex`. Split out from bitcoin#19306. Only trivial thread safety annotations and lock assertions added. No new locks. No behavior change. Refactoring `const uint256` to `const uint256&` was [requested](bitcoin#19647 (comment)) by **promag**. Please note that now, since bitcoin#19668 has been merged, it is safe to apply `AssertLockHeld()` macros as they do not swallow compile time Thread Safety Analysis warnings. ACKs for top commit: promag: Core review ACK 020f051. jnewbery: Code review ACK 020f051 vasild: ACK 020f051 Tree-SHA512: a31e389142d5a19b25fef0aaf1072a337278564528b5cc9209df88ae548a31440e1b8dd9bae0169fd7aa59ea06e22fe5e0413955386512b83ef1f3e7d941e890
Fabcien
pushed a commit
to Bitcoin-ABC/bitcoin-abc
that referenced
this pull request
Sep 22, 2021
Summary: Only trivial thread safety annotations and lock assertions added. No new locks. No change in behavior, the lock is already held at call sites. This is a backport of [[bitcoin/bitcoin#19854 | core#19854]] Test Plan: With TSAN: `ninja && ninja check check-functional` Reviewers: #bitcoin_abc, Fabien Reviewed By: #bitcoin_abc, Fabien Differential Revision: https://reviews.bitcoinabc.org/D10177
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This is another step to transit
CTxMemPool::csfromRecursiveMutextoMutex.Split out from #19306.
Only trivial thread safety annotations and lock assertions added. No new locks. No behavior change.
Refactoring
const uint256toconst 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.