-
Notifications
You must be signed in to change notification settings - Fork 38.7k
doc: Add cs_main lock annotations for mapBlockIndex #15321
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
Concept ACK Thanks for adding this missing annotation. |
fa5349e to
fa36350
Compare
fa36350 to
fa2a69f
Compare
promag
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Concept ACK.
| * Mark one block file as pruned. | ||
| */ | ||
| void PruneOneBlockFile(const int fileNumber); | ||
| void PruneOneBlockFile(const int fileNumber) EXCLUSIVE_LOCKS_REQUIRED(cs_main); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this necessary?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Without it I get:
CXX wallet/libbitcoin_wallet_a-wallet.o
validation.cpp:3623:28: warning: reading variable 'mapBlockIndex' requires holding mutex 'cs_main' [-Wthread-safety-analysis]
for (const auto& entry : mapBlockIndex) {
^
validation.cpp:3623:28: warning: reading variable 'mapBlockIndex' requires holding mutex 'cs_main' [-Wthread-safety-analysis]
CXX wallet/libbitcoin_wallet_a-walletdb.o
|
utACK fa2a69f |
fa2a69f doc: Add cs_main lock annotations for mapBlockIndex (practicalswift) Pull request description: Marked as "doc" because it didn't change the bitcoind on my system with default configure settings for both gcc and clang. Tree-SHA512: ba203f16c1cdc834a61c65bb5fb20bbaf7d8bff0c3a1b8ef46bc1d3669092191221e26abd7e580efab2f9bd5a992dc363251f1b68c6cd68f8204d62675868cf1
Summary: ``` Previously the argument would be untouched if the first block scan failed. This makes the behavior predictable, and consistent with the documentation. ``` Backport of core [[bitcoin/bitcoin#14957 | PR14957]] and the remaining of [[bitcoin/bitcoin#15321 | PR15321]] (see D5238). Depends on D5563. Test Plan: With Clang: cmake -GNinja .. -DCMAKE_BUILD_TYPE=Debug -DENABLE_WERROR=ON ninja all check check-functional Reviewers: #bitcoin_abc, deadalnix Reviewed By: #bitcoin_abc, deadalnix Differential Revision: https://reviews.bitcoinabc.org/D5564
zcash: cherry picked from commit fa2a69f zcash: bitcoin/bitcoin#15321
zcash: cherry picked from commit fa2a69f zcash: bitcoin/bitcoin#15321
Marked as "doc" because it didn't change the bitcoind on my system with default configure settings for both gcc and clang.